On 9/17/19 2:17 PM Joao Pedro Abreu De Souza wrote:
cl from visual studio 2017.
Em ter, 17 de set de 2019 03:26, Stéphane Ancelot
<sance...@numalliance.com <mailto:sance...@numalliance.com>> escreveu:
Hi,
That first depends on which compiler you will use ?
Regards,
S.Ancelot
Le 16/09/2019 à 22:32, Joao Pedro Abreu De Souza a écrit :
Hi guys. I am trying to generate,using cmake, a executable with
target Windows 32 bits using Windows 64 bits, but cannot find a
standard toolchain file (I find to Linux, to Android, but can't
find to Windows 32 bits) to build. Do you know some repository of
toolchain files that has Windows 32 bits from Windows 64 bits? Or
maybe someone has a standard toolchain file to this type of thing.
Well, I don't have a toolchain file for your compiler, but maybe my
toolchain file for cross compilation under Linux for Windows (64-bit)
can help. You'll need to adjust compiler and paths...
$ cat mingw-w64_toolchain.cmake
# CMake Toolchain File for MinGW-w64 (64-bit) Cross Compilation
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
# which tools to use
set(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
# here is where the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
# adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_INSTALL_PREFIX ${CMAKE_FIND_ROOT_PATH}/usr CACHE FILEPATH
"install path prefix")
# initialize required linker flags
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc -static-libstdc++")
# end of toolchain file
HTH. YMMV
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake