Skip to content

Commit 4ba3c61

Browse files
author
Andreas Schniertshauer
committed
Change: CMake, allow the developer to select if Dynamic or Static libraries are built
1 parent 2a2f97e commit 4ba3c61

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ if (NOT MSVC)
2121
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
2222
endif ()
2323

24+
# https://cmake.org/Wiki/BuildingWinDLL
25+
# Allow the developer to select if Dynamic or Static libraries are built, default is static.
26+
OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
27+
# Set the LIB_TYPE variable to STATIC
28+
SET (LIB_TYPE STATIC)
29+
IF (BUILD_SHARED_LIBS)
30+
# User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED'
31+
SET (LIB_TYPE SHARED)
32+
ENDIF (BUILD_SHARED_LIBS)
33+
2434
add_library (utf8proc
35+
${LIB_TYPE}
2536
utf8proc.c
2637
utf8proc.h
2738
)

0 commit comments

Comments
 (0)