mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-06 18:56:40 -04:00
Declare BUILD_SHARED_LIBS option for discoverability (#440)
BUILD_SHARED_LIBS is a standard CMake variable, but we declare it explicitly to make it prominent
This commit is contained in:
commit
6bc108b452
@ -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")
|
||||
@ -230,8 +233,9 @@ 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)
|
||||
message(STATUS "Build shared libraries (DLLs).")
|
||||
target_compile_definitions(SQLiteCpp PUBLIC "SQLITECPP_COMPILE_DLL")
|
||||
target_compile_definitions(SQLiteCpp PRIVATE "SQLITECPP_DLL_EXPORT")
|
||||
endif()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user