summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-07 01:39:26 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-07 01:39:26 +0200
commit3ad9130b6fd61c926678e720bf31504851fbd7b8 (patch)
tree1b751d2000ef369192207eaa40d1396a1cc02313
parent0e18007eda171cc96f53fa668a09537287af3b8e (diff)
downloadfastd-3ad9130b6fd61c926678e720bf31504851fbd7b8.tar
fastd-3ad9130b6fd61c926678e720bf31504851fbd7b8.zip
Disable incompatible CMake options on non-Linux systems
-rw-r--r--CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c06dc8a..ae76437 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,13 @@ pkg_check_modules(UECC REQUIRED libuecc>=3)
find_package(NaCl REQUIRED)
-set(WITH_CAPABILITIES TRUE CACHE BOOL "Include support for POSIX capabilities")
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(LINUX TRUE)
+else()
+ set(LINUX FALSE)
+endif()
+
+set(WITH_CAPABILITIES ${LINUX} CACHE BOOL "Include support for POSIX capabilities")
if(WITH_CAPABILITIES)
find_package(CAP REQUIRED)
@@ -28,10 +34,12 @@ else(WITH_CAPABILITIES)
endif(WITH_CAPABILITIES)
set(WITH_CRYPTO_AES128CTR_NACL TRUE CACHE BOOL "Include the AES128-CTR implementation from the NaCl library")
-set(WITH_CRYPTO_AES128CTR_LINUX TRUE CACHE BOOL "Support using the AES128-CTR implementation in the Linux kernel")
-
set(WITH_CRYPTO_GHASH_BUILTIN TRUE CACHE BOOL "Include the built-in GHASH implementation")
-set(WITH_CRYPTO_GHASH_LINUX TRUE CACHE BOOL "Support using the GHASH implementation in the Linux kernel")
+
+if(LINUX)
+ set(WITH_CRYPTO_AES128CTR_LINUX TRUE CACHE BOOL "Support using the AES128-CTR implementation in the Linux kernel")
+ set(WITH_CRYPTO_GHASH_LINUX TRUE CACHE BOOL "Support using the GHASH implementation in the Linux kernel")
+endif(LINUX)
set(WITH_METHOD_XSALSA20_POLY1305 TRUE CACHE BOOL "Include xsalsa20-poly1305 method")
set(WITH_METHOD_AES128_GCM TRUE CACHE BOOL "Include aes128-gcm method")