aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-27 18:58:04 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-27 18:58:04 +0400
commite389ab727d6eb1024567c2629150a72fc26fb7ef (patch)
treed92c275da185d632c7141d82b72798b5e97f839b
parentd450657c9040e77057fdcaf2151537f7ad46580f (diff)
downloadrspamd-e389ab727d6eb1024567c2629150a72fc26fb7ef.tar.gz
rspamd-e389ab727d6eb1024567c2629150a72fc26fb7ef.zip
Detect amd64.
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80045a4bb..565cabe04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,19 @@ IF(CMAKE_INSTALL_PREFIX)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
ENDIF(CMAKE_INSTALL_PREFIX)
+# Try to detect platform for further configuration
+CHECK_C_SOURCE_COMPILES ("#if !defined(__x86_64) && !defined(__amd64) && !defined(_M_X64)
+ #error assume 32 bit arch
+ #endif
+ int main() { return 0;}" AMD_64)
+IF(NOT BUILD_CPU_MODE)
+ IF(AMD_64)
+ SET (BUILD_CPU_MODE "64")
+ ELSE(AMD_64)
+ SET (BUILD_CPU_MODE "32")
+ ENDIF(AMD_64)
+ENDIF(NOT BUILD_CPU_MODE)
+
# Platform specific configuration
IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -DFREEBSD")