From 1c75ed72e32e3155490382f0716a732f86069b52 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sun, 27 Nov 2011 12:46:32 +0100 Subject: Adding cross-compile option. --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 366b4c4..64fd73f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,15 @@ project(pChase) SET(CMAKE_BUILD_TYPE "Release") +option(CROSS_32BIT "Cross-build a 32-bit binary on a 64-bit system" OFF) +if (CROSS_32BIT) + message(STATUS "NOTICE: building a 32-bit binary") + add_definitions(-m32) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32") + set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32") +endif () + set (pChase_VERSION_MAJOR 0) set (pChase_VERSION_MINOR 4) -- cgit v1.2.3