We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
BUILD_SHARED_LIBS
1 parent 97c87df commit e15f91dCopy full SHA for e15f91d
CMakeLists.txt
@@ -11,7 +11,7 @@ project(
11
)
12
13
option(BUILD_TESTS "Build test programs for the library" OFF)
14
-option(BUILD_STATIC_LIBRARY "Build the library as static rather than shared" OFF)
+option(BUILD_SHARED_LIBS "Build the library as a shared (dynamically-linked) object rather than a static one " ON)
15
16
# Boolean options which go into config.h
17
@@ -76,11 +76,8 @@ validate_type_size("intmax_t")
76
validate_type_size("size_t")
77
validate_type_size("ptrdiff_t")
78
79
-if (BUILD_STATIC_LIBRARY)
80
- add_library(printf STATIC)
81
-else()
82
- add_library(printf SHARED)
83
-endif()
+# Note we've defined BUILD_SHARED_LIBS, which affects the following
+add_library(printf)
84
85
add_library("printf::printf" ALIAS printf)
86
0 commit comments