Skip to content

Commit

Permalink
Fixes #174: Now utilizing the standard BUILD_SHARED_LIBS variable t…
Browse files Browse the repository at this point in the history
…o control whether the library is built statically
  • Loading branch information
eyalroz authored and Eyal Rozenberg committed Dec 19, 2023
1 parent 919a16c commit af05afe
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(
)

option(BUILD_TESTS "Build test programs for the library" OFF)
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)

# Boolean options which go into config.h

Expand Down Expand Up @@ -76,11 +76,8 @@ validate_type_size("intmax_t")
validate_type_size("size_t")
validate_type_size("ptrdiff_t")

if (BUILD_STATIC_LIBRARY)
add_library(printf STATIC)
else()
add_library(printf SHARED)
endif()
# Note we've defined BUILD_SHARED_LIBS, which affects the following
add_library(printf)

add_library("printf::printf" ALIAS printf)

Expand Down

0 comments on commit af05afe

Please sign in to comment.