Bump version to 1.4.2
[socket_wrapper.git] / cmake / Toolchain-cross-m32.cmake
1 set(CMAKE_C_FLAGS "-m32" CACHE STRING "C compiler flags"   FORCE)
2 set(CMAKE_CXX_FLAGS "-m32" CACHE STRING "C++ compiler flags" FORCE)
3
4 set(LIB32 /usr/lib) # Fedora
5
6 if(EXISTS /usr/lib32)
7     set(LIB32 /usr/lib32) # Arch, Solus
8 endif()
9
10 set(CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
11 set(CMAKE_LIBRARY_PATH        ${LIB32} CACHE STRING "library search path"        FORCE)
12
13 # this is probably unlikely to be needed, but just in case
14 set(CMAKE_EXE_LINKER_FLAGS    "-m32 -L${LIB32}" CACHE STRING "executable linker flags"     FORCE)
15 set(CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
16 set(CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags"         FORCE)
17
18 # on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
19 # to include the regular system .pc files as well (at the end), because some
20 # are not always present in the 32 bit directory
21 if(EXISTS ${LIB32}/pkgconfig)
22     set(ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
23 endiF()