aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2016-04-11 12:59:23 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2016-04-14 15:16:52 +0900
commitbda62f7fe4ad3965f8f6e7f06838c76455340567 (patch)
tree8686094e11d548e14d3207e8c80fc0b3183cfed2 /CMakeLists.txt
parentc94670a8cd39f8a8843e9adba2a6030adb00ac94 (diff)
downloadportable-bda62f7fe4ad3965f8f6e7f06838c76455340567.tar.gz
portable-bda62f7fe4ad3965f8f6e7f06838c76455340567.tar.bz2
portable-bda62f7fe4ad3965f8f6e7f06838c76455340567.zip
add cmake build options
- add cmake build options as configure provides * -DENABLE_ASM (default ON) * -DENABLE_EXTRATESTS (default OFF) * -DENABLE_NC (default OFF) * -DOPENSSLDIR (default ${CMAKE_INSTALL_PREFIX}/etc/ssl) - add biotest and pidwraptest if ENABLE_EXTRATESTS is ON - add compiler flag `-fno-common` if CMAKE_SYSTEM_NAME is Darwin to prevent link error Undefined symbols "_OPENSSL_ia32cap_P"
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e12909..595e829 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,17 @@ string(STRIP ${TLS_VERSION} TLS_VERSION)
23string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) 23string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION})
24string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) 24string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})
25 25
26option(ENABLE_ASM "Enable assembly" ON)
27option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF)
28option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF)
29set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE)
30
31set(BUILD_NC true)
32
33if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
34 add_definitions(-fno-common)
35endif()
36
26if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") 37if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
27 add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) 38 add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__)
28endif() 39endif()
@@ -34,6 +45,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
34 add_definitions(-D_GNU_SOURCE) 45 add_definitions(-D_GNU_SOURCE)
35endif() 46endif()
36 47
48if(CMAKE_SYSTEM_NAME MATCHES "MINGW")
49 set(BUILD_NC false)
50endif()
51
37if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") 52if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
38 if(CMAKE_C_COMPILER MATCHES "gcc") 53 if(CMAKE_C_COMPILER MATCHES "gcc")
39 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing") 54 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing")