1
1
cmake_minimum_required (VERSION 3.16 )
2
- project (cotp VERSION "2.0.1 " LANGUAGES "C" )
2
+ project (cotp VERSION "2.0.2 " LANGUAGES "C" )
3
3
4
4
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} /cmake )
5
5
@@ -8,6 +8,8 @@ include(GNUInstallDirs)
8
8
find_package (PkgConfig REQUIRED )
9
9
find_package (Gcrypt 1.8.0 REQUIRED )
10
10
11
+ option (BUILD_SHARED_LIBS "Build libcotp as a shared library" ON )
12
+
11
13
include_directories (${GCRYPT_INCLUDE_DIR} ${BASEENCODE_INCLUDE_DIRS} )
12
14
13
15
link_directories (${GCRYPT_LIBRARY_DIRS} ${BASEENCODE_LIBRARY_DIRS} )
@@ -32,9 +34,21 @@ add_compile_options(-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fst
32
34
33
35
add_link_options (-Wl,--no-add-needed -Wl,--as-needed -Wl,-z,relro,-z,now )
34
36
35
- add_library (cotp SHARED ${SOURCE_FILES} )
37
+ add_library (cotp ${SOURCE_FILES} )
36
38
37
39
target_link_libraries (cotp ${GCRYPT_LIBRARIES} )
40
+ target_include_directories (cotp
41
+ PUBLIC
42
+ ${CMAKE_CURRENT_SOURCE_DIR} /src
43
+ PRIVATE
44
+ ${GCRYPT_INCLUDE_DIR}
45
+ ${BASEENCODE_INCLUDE_DIRS} )
46
+ target_compile_options (cotp PRIVATE
47
+ -Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute
48
+ -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast
49
+ -Wcast-align -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare -Wno-format-nonliteral -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 )
50
+ target_link_directories (cotp PRIVATE
51
+ ${GCRYPT_LIBRARY_DIRS} ${BASEENCODE_LIBRARY_DIRS} )
38
52
39
53
set_target_properties (cotp PROPERTIES VERSION ${CMAKE_PROJECT_VERSION} SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR} )
40
54
0 commit comments