Skip to content

Commit

Permalink
allow building static library
Browse files Browse the repository at this point in the history
  • Loading branch information
Anotra committed Mar 23, 2024
1 parent e883bdb commit 939b1c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ enable_language(C)

option(WITH_LOCKS "add lock support if available" ON)
option(BUILD_TESTS "enable testing" ON)
option(SHARED "build shared library(off for static library)" ON)

if (WITH_LOCKS AND NOT WIN32)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()

project(anomap VERSION 1.0.0 LANGUAGES C)
add_library(${PROJECT_NAME} SHARED anomap.c)
if (SHARED)
add_library(${PROJECT_NAME} SHARED)
else()
add_library(${PROJECT_NAME} STATIC)
endif()
target_sources(${PROJECT_NAME} PRIVATE
anomap.c
)
target_include_directories(${PROJECT_NAME} PUBLIC include)
set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99 C_STANDARD_REQUIRED ON)
if (NOT WITH_LOCKS)
Expand Down

0 comments on commit 939b1c4

Please sign in to comment.