summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-03 17:54:36 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-03 18:00:10 +0200
commit64257e6eae4e5e73052c8249316df08b91a2445a (patch)
treeca78b5c8397b06459104e32658a3fa5899d58899 /cmake
parent639ea07d775056f1bcbc5a8df1a9d7a68eab4d33 (diff)
downloadfastd-64257e6eae4e5e73052c8249316df08b91a2445a.tar
fastd-64257e6eae4e5e73052c8249316df08b91a2445a.zip
Fix UHASH build on MacOS X
Diffstat (limited to 'cmake')
-rw-r--r--cmake/checks.cmake44
1 files changed, 23 insertions, 21 deletions
diff --git a/cmake/checks.cmake b/cmake/checks.cmake
index d42f336..f9f0399 100644
--- a/cmake/checks.cmake
+++ b/cmake/checks.cmake
@@ -61,31 +61,33 @@ string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_ETHHDR)
set(CMAKE_REQUIRED_INCLUDES "sys/types.h")
-check_c_source_compiles("
-#include <endian.h>
-
-int main() {
- return 0;
-}
-" HAVE_ENDIAN_H)
-
-if(HAVE_ENDIAN_H)
- check_symbol_exists("be32toh" "endian.h" HAVE_LINUX_ENDIAN)
-
-else(HAVE_ENDIAN_H)
+if(NOT DARWIN)
check_c_source_compiles("
- #include <sys/types.h>
- #include <sys/endian.h>
+ #include <endian.h>
int main() {
return 0;
}
- " HAVE_SYS_ENDIAN_H)
+ " HAVE_ENDIAN_H)
+
+ if(HAVE_ENDIAN_H)
+ check_symbol_exists("be32toh" "endian.h" HAVE_LINUX_ENDIAN)
+
+ else(HAVE_ENDIAN_H)
+ check_c_source_compiles("
+ #include <sys/types.h>
+ #include <sys/endian.h>
- if(HAVE_SYS_ENDIAN_H)
- check_symbol_exists("be32toh" "sys/types.h;sys/endian.h" HAVE_LINUX_ENDIAN)
+ int main() {
+ return 0;
+ }
+ " HAVE_SYS_ENDIAN_H)
- else(HAVE_SYS_ENDIAN_H)
- message(FATAL_ERROR "Neither <endian.h> nor <sys/endian.h> found")
- endif(HAVE_SYS_ENDIAN_H)
-endif(HAVE_ENDIAN_H)
+ if(HAVE_SYS_ENDIAN_H)
+ check_symbol_exists("be32toh" "sys/types.h;sys/endian.h" HAVE_LINUX_ENDIAN)
+
+ else(HAVE_SYS_ENDIAN_H)
+ message(FATAL_ERROR "Neither <endian.h> nor <sys/endian.h> found")
+ endif(HAVE_SYS_ENDIAN_H)
+ endif(HAVE_ENDIAN_H)
+endif(NOT DARWIN)