CrossCompile com CMAKE e Mingw

0

Eu fiz um arquivo toolchain cmake para construir para o windows x86 e x64 do linux usando o mingw. Construir um projeto para o alvo do Windows x86_x64 funciona como um encanto, mas para o Windows i686 da mesma forma que eu construo o último me dá um erro.

construção para i686:

cmake -DCMAKE_TOOLCHAIN_FILE=../vendor/Libellum/Win32/gcc-cross-compiler-i686.cmake ..

erro:

../vendor/Libellum/Win32/toolchain-i686/lib/libboost_system-mt.a(error_code.o):(.text+0x15f): undefined reference to '_Unwind_Resume'
../vendor/Libellum/Win32/toolchain-i686/lib/libboost_system-mt.a(error_code.o):(.text+0x179): undefined reference to '_Unwind_Resume'
../vendor/Libellum/Win32/toolchain-i686/lib/libboost_system-mt.a(error_code.o):(.text+0xcf6): undefined reference to '_Unwind_Resume'
../vendor/Libellum/Win32/toolchain-i686/lib/libboost_system-mt.a(error_code.o):(.eh_frame$_ZN5boost6system6detail25local_free_on_destructionD1Ev+0x13): undefined reference to '__gxx_personality_v0'
../vendor/Libellum/Win32/toolchain-i686/lib/libboost_system-mt.a(error_code.o):(.eh_frame+0xab): undefined reference to '__gxx_personality_v0'
collect2: error: ld returned 1 exit status
CMakeFiles/Libellum.dir/build.make:425: recipe for target 'Libellum.exe' failed
make[2]: *** [Libellum.exe] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/Libellum.dir/all' failed
make[1]: *** [CMakeFiles/Libellum.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

o arquivo gcc-cross-compilador-i686.cmake:

set(CROSS_COMPILE_TOOLCHAIN_PATH "/usr/bin/")
set(CROSS_COMPILE_TOOLCHAIN_PREFIX "i686-w64-mingw32")
set(CROSS_COMPILE_SYSROOT "/usr/i686-w64-mingw32/")

SET(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-mingw32-windres)
SET(CMAKE_CXX_LINK_EXECUTABLE  i686-w64-mingw32-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(wintool Win32)
    
por Pedro Soares 05.04.2018 / 21:51

0 respostas