diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2016-04-11 12:59:23 +0900 |
---|---|---|
committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2016-04-14 15:16:52 +0900 |
commit | bda62f7fe4ad3965f8f6e7f06838c76455340567 (patch) | |
tree | 8686094e11d548e14d3207e8c80fc0b3183cfed2 /CMakeLists.txt | |
parent | c94670a8cd39f8a8843e9adba2a6030adb00ac94 (diff) | |
download | portable-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.txt | 15 |
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) | |||
23 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) | 23 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) |
24 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) | 24 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) |
25 | 25 | ||
26 | option(ENABLE_ASM "Enable assembly" ON) | ||
27 | option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF) | ||
28 | option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF) | ||
29 | set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE) | ||
30 | |||
31 | set(BUILD_NC true) | ||
32 | |||
33 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") | ||
34 | add_definitions(-fno-common) | ||
35 | endif() | ||
36 | |||
26 | if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") | 37 | if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") |
27 | add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) | 38 | add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) |
28 | endif() | 39 | endif() |
@@ -34,6 +45,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") | |||
34 | add_definitions(-D_GNU_SOURCE) | 45 | add_definitions(-D_GNU_SOURCE) |
35 | endif() | 46 | endif() |
36 | 47 | ||
48 | if(CMAKE_SYSTEM_NAME MATCHES "MINGW") | ||
49 | set(BUILD_NC false) | ||
50 | endif() | ||
51 | |||
37 | if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") | 52 | if(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") |