Skip to content

Commit c027042

Browse files
Use standard BUILD_SHARED_LIBS instead of custom DYLIB_SHARED
Signed-off-by: Martin Olivier <martin.olivier@live.fr>
1 parent 9bc9c0b commit c027042

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ set(SOURCES
1414
src/format.cpp
1515
)
1616

17-
if(DYLIB_SHARED)
18-
add_library(dylib SHARED ${SOURCES})
19-
if(WIN32)
20-
set_target_properties(dylib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
21-
endif()
22-
else()
23-
add_library(dylib STATIC ${SOURCES})
24-
endif()
17+
add_library(dylib ${SOURCES})
2518

19+
if(BUILD_SHARED_LIBS AND WIN32)
20+
set_target_properties(dylib PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
21+
endif()
2622

2723
target_include_directories(dylib
2824
PUBLIC
@@ -79,7 +75,6 @@ install(
7975

8076
option(DYLIB_BUILD_TESTS "When set to ON, build unit tests" OFF)
8177
option(DYLIB_WARNING_AS_ERRORS "Treat warnings as errors" OFF)
82-
option(DYLIB_SHARED "Build as shared object" ON)
8378

8479
if(DYLIB_BUILD_TESTS)
8580
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
@@ -132,5 +127,3 @@ if(DYLIB_BUILD_TESTS)
132127
include(GoogleTest)
133128
gtest_discover_tests(unit_tests PROPERTIES DISCOVERY_TIMEOUT 600 WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
134129
endif()
135-
136-

0 commit comments

Comments
 (0)