Skip to content

Commit 9489024

Browse files
committed
Config MT for static build and MD for dynamic build
1 parent 9dffcc4 commit 9489024

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

sqlcipher.cmake

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,22 @@ else()
307307
endif()
308308

309309
if(WIN32)
310-
target_compile_options(sqlcipher PRIVATE
311-
/W4
312-
$<$<CONFIG:>:/MT> #---------|
313-
$<$<CONFIG:Debug>:/MTd> #---|-- Statically link the runtime libraries
314-
$<$<CONFIG:Release>:/MT> #--|
315-
$<$<CONFIG:RelWithDebInfo>:/MT>
316-
)
310+
target_compile_options(sqlcipher PRIVATE /W4)
311+
if (BUILD_SHARED_LIBS)
312+
target_compile_options(sqlcipher PRIVATE
313+
$<$<CONFIG:>:/MD> #---------|
314+
$<$<CONFIG:Debug>:/MDd> #---|-- Dynamic link the runtime libraries
315+
$<$<CONFIG:Release>:/MD> #--|
316+
$<$<CONFIG:RelWithDebInfo>:/MD>
317+
)
318+
else ()
319+
target_compile_options(sqlcipher PRIVATE
320+
$<$<CONFIG:>:/MT> #---------|
321+
$<$<CONFIG:Debug>:/MTd> #---|-- Statically link the runtime libraries
322+
$<$<CONFIG:Release>:/MT> #--|
323+
$<$<CONFIG:RelWithDebInfo>:/MT>
324+
)
325+
endif()
317326
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
318327
set(CMAKE_C_FLAGS "-Wno-implicit-function-declaration")
319328
set(CMAKE_CXX_FLAGS "-Wno-implicit-function-declaration")

0 commit comments

Comments
 (0)