Skip to content

Commit

Permalink
Declare BUILD_SHARED_LIBS option for discoverability
Browse files Browse the repository at this point in the history
BUILD_SHARED_LIBS is a standard CMake variable, but we declare it explicitly to make it prominent
  • Loading branch information
SRombauts committed Aug 18, 2023
1 parent d8ac3b2 commit 47310fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ message (STATUS "Project version: ${PROJECT_VERSION}")

option(SQLITECPP_BUILD_TESTS "Build and run tests." OFF)

# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make it prominent
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)

# Define useful variables to handle OS differences:
if (WIN32)
set(DEV_NULL "NUL")
Expand Down Expand Up @@ -213,8 +216,8 @@ if (SQLITE_USE_LEGACY_STRUCT)
target_compile_definitions(SQLiteCpp PUBLIC SQLITE_USE_LEGACY_STRUCT)
endif (SQLITE_USE_LEGACY_STRUCT)

if(BUILD_SHARED_LIBS)
if(WIN32)
if (BUILD_SHARED_LIBS)
if (WIN32)
target_compile_definitions(SQLiteCpp PUBLIC "SQLITECPP_COMPILE_DLL")
target_compile_definitions(SQLiteCpp PRIVATE "SQLITECPP_DLL_EXPORT")
endif()
Expand Down
4 changes: 2 additions & 2 deletions sqlite3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ add_library(sqlite3
sqlite3.h
)

if(WIN32)
if(BUILD_SHARED_LIBS)
if (WIN32)
if (BUILD_SHARED_LIBS)
add_definitions("-DSQLITE_API=__declspec(dllexport)")
endif()
endif()
Expand Down

0 comments on commit 47310fd

Please sign in to comment.