Skip to content

Commit d7975e6

Browse files
Merge pull request #51 from paolostivanin/dev2_0_2
Release 2.0.2
2 parents f88829c + 1751bb1 commit d7975e6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(cotp VERSION "2.0.1" LANGUAGES "C")
2+
project(cotp VERSION "2.0.2" LANGUAGES "C")
33

44
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
55

@@ -8,6 +8,8 @@ include(GNUInstallDirs)
88
find_package(PkgConfig REQUIRED)
99
find_package(Gcrypt 1.8.0 REQUIRED)
1010

11+
option(BUILD_SHARED_LIBS "Build libcotp as a shared library" ON)
12+
1113
include_directories(${GCRYPT_INCLUDE_DIR} ${BASEENCODE_INCLUDE_DIRS})
1214

1315
link_directories(${GCRYPT_LIBRARY_DIRS} ${BASEENCODE_LIBRARY_DIRS})
@@ -32,9 +34,21 @@ add_compile_options(-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fst
3234

3335
add_link_options(-Wl,--no-add-needed -Wl,--as-needed -Wl,-z,relro,-z,now)
3436

35-
add_library(cotp SHARED ${SOURCE_FILES})
37+
add_library(cotp ${SOURCE_FILES})
3638

3739
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})
3852

3953
set_target_properties(cotp PROPERTIES VERSION ${CMAKE_PROJECT_VERSION} SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR})
4054

0 commit comments

Comments
 (0)