Skip to content

Commit e15f91d

Browse files
committed
Fixes #174: Now utilizing the standard BUILD_SHARED_LIBS variable to control whether the library is built statically
1 parent 97c87df commit e15f91d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

CMakeLists.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project(
1111
)
1212

1313
option(BUILD_TESTS "Build test programs for the library" OFF)
14-
option(BUILD_STATIC_LIBRARY "Build the library as static rather than shared" OFF)
14+
option(BUILD_SHARED_LIBS "Build the library as a shared (dynamically-linked) object rather than a static one " ON)
1515

1616
# Boolean options which go into config.h
1717

@@ -76,11 +76,8 @@ validate_type_size("intmax_t")
7676
validate_type_size("size_t")
7777
validate_type_size("ptrdiff_t")
7878

79-
if (BUILD_STATIC_LIBRARY)
80-
add_library(printf STATIC)
81-
else()
82-
add_library(printf SHARED)
83-
endif()
79+
# Note we've defined BUILD_SHARED_LIBS, which affects the following
80+
add_library(printf)
8481

8582
add_library("printf::printf" ALIAS printf)
8683

0 commit comments

Comments
 (0)