]> source.dussan.org Git - rspamd.git/commitdiff
Detect amd64.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 27 Mar 2012 14:58:04 +0000 (18:58 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 27 Mar 2012 14:58:04 +0000 (18:58 +0400)
CMakeLists.txt

index 80045a4bb140f2bae7bb5eb2de8779689f01a5e9..565cabe0497ea8c3aa9139bb6c2fac3d482477d8 100644 (file)
@@ -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")