aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-20 23:24:20 +0200
committerSven Gothel <[email protected]>2013-04-20 23:24:20 +0200
commit5e0bdc8af4bff7659d1b41b09fe8f166e0842c36 (patch)
tree6799becfbb73020ed48149861fdd4655327f20ac /cmake
parent4e35b8521dea1e1fdf940b7bc719cf3a349bbf25 (diff)
Add toolchain.gcc-x86_32.cmake for x86_64 -> x86_32 crosscompilation
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchain.gcc-x86_32.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/toolchain.gcc-x86_32.cmake b/cmake/toolchain.gcc-x86_32.cmake
new file mode 100644
index 00000000..4afdb9de
--- /dev/null
+++ b/cmake/toolchain.gcc-x86_32.cmake
@@ -0,0 +1,17 @@
+# For multiarch crosscompile, i.e. x86_32 target on x86_64 host
+
+set(CMAKE_SYSTEM_PROCESSOR "x86")
+
+link_directories("/usr/lib32")
+
+set(CMAKE_C_FLAGS "-m32")
+
+set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
+
+set(LINKER_FLAGS "-m32 -static-libgcc")
+
+set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
+set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
+set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
+