From 8f8eee616887fe27f84ee876a2982ef22e734d3c Mon Sep 17 00:00:00 2001 From: Pierre Proske Date: Tue, 7 Feb 2023 12:45:31 +1100 Subject: [PATCH] Simplify CMake for shared libs --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d94b4f..6d34baa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,7 +216,7 @@ endif (SQLITE_USE_LEGACY_STRUCT) if(BUILD_SHARED_LIBS) if(WIN32) add_definitions("-DSQLITECPP_COMPILE_DLL") - target_compile_definitions(SQLiteCpp PRIVATE "SQLITECPP_DLL_EXPORT=1") + target_compile_definitions(SQLiteCpp PRIVATE "SQLITECPP_DLL_EXPORT") endif() endif() @@ -412,11 +412,7 @@ if (SQLITECPP_BUILD_EXAMPLES) # add the basic example executable add_executable(SQLiteCpp_example1 ${SQLITECPP_EXAMPLES}) - if(BUILD_SHARED_LIBS) - if(WIN32) - target_compile_definitions(SQLiteCpp_example1 PRIVATE "SQLITECPP_DLL_EXPORT=0") - endif() - endif() + target_link_libraries(SQLiteCpp_example1 SQLiteCpp) if (MSYS OR MINGW) target_link_libraries(SQLiteCpp_example1 ssp)