Declare BUILD_SHARED_LIBS option for discoverability

BUILD_SHARED_LIBS is a standard CMake variable, but we declare it explicitly to make it prominent
This commit is contained in:
Sébastien Rombauts 2023-08-18 12:29:54 +02:00
parent dfa4dd8005
commit e6f2c000e6
2 changed files with 8 additions and 4 deletions

View File

@ -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")
@ -232,6 +235,7 @@ endif (SQLITE_USE_LEGACY_STRUCT)
if (BUILD_SHARED_LIBS)
if (WIN32)
message(STATUS "Build shared libraries (DLLs).")
target_compile_definitions(SQLiteCpp PUBLIC "SQLITECPP_COMPILE_DLL")
target_compile_definitions(SQLiteCpp PRIVATE "SQLITECPP_DLL_EXPORT")
endif()