Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-19 Thread Juan E. Sanchez
Hello, Perhaps you can start by not using the .bat scripts and using the .exe instead. You can run cmake from a visual studio environment, and instead of invoking a visual studio environment for each command. And to build from your script: cmake --build . Regards, Juan On 9/19/19 12:59

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-19 Thread Joao Pedro Abreu De Souza
Now, with this toolchain file: -start of toolchain file--- set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR "x86") set(CMAKE_SYSTEM_VERSION 1) # Microsoft MSVC compiler #set(CMAKE_C_COMPILER cl.exe) #set(CMAKE_CXX_COMPILER cl.exe) set(CMAKE_C_COMPILER

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-19 Thread Gonzalo Garramuño
El 17/9/19 a las 16:46, fdk17 escribió: I personally never seen anyone try to use the Ninja generator via command line CMake and use the cl.exe compiler. I've only seen that using Visual Studio to open a CMakeLists.txt file it can produce a Ninja project.  But even MS documentation states

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-18 Thread Eric Doenges
If the environment is set up correctly, the MSVC tools should be able to find the correct versions of the runtime libraries automatically. If you are using the wrapper script approach, the problem is most likely that when using MSVC, linking is done by calling the linker directly instead of

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-18 Thread Joao Pedro Abreu De Souza
Cool. I try using this toolchain in a toy project, just to test, and execute the cmake inside cross-compiling x64_x86 from visual studio 2017 and all work as expected, except the linking from ninja, that break because cannot find printf. Is absolutely cool, better than my last toolchain. Do you

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Eric Doenges
We use ninja for building on Windows. Our toolchain file for the MSVC compiler is really simple (this is for MSVC 18.0, 32 bits): --- SNIP --- set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR "x86") set(CMAKE_SYSTEM_VERSION 1) # Microsoft MSVC compiler set(CMAKE_C_COMPILER cl.exe)

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Joao Pedro Abreu De Souza
Well, the Visual Studio Generator alone is not a option because the repository has a actual build system(a bunch of bat files that call a python script that generate ninja files). We want to change to cmake, and now we don't use Visual Studio a lot. Most of time, we only need their compiler and

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread fdk17
As I recall for myself, simply using the Visual Studio Generator with the -A option was all that was needed to build for Win32. You don't need a toolchain file because the generator already knows how to setup a Visual Studio Project to target Win32. Even the documentation for cross-compiling

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Joao Pedro Abreu De Souza
Thanks, I'll check it out. The toolchain file, as is, can generate ninja builds that can be used to generate a executable, but when I execute them, he say : ``` -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: C:/Program

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Juan Sanchez
>From my brief research, it looks like the Microsoft version of CMake may have Ninja support. https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio-whats-new-in-2017-15-3-update/ Regards, Juan On Tue, Sep 17, 2019 at 1:36 PM Joao Pedro Abreu De Souza < jp_ab...@id.uff.br>

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Joao Pedro Abreu De Souza
So, only the Visual Studio generator use the Arch option? I try generate ninja build, but cmake(3.15.3) and the answer was ``` $ cmake -B build -S . -G "Ninja" -A Win32 CMake Error at CMakeLists.txt:2 (project): Generator Ninja does not support platform specification, but platform

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Guy Mac
AFAIK you can set the generator in a CMakeSettings.json file if you are using MSVC. https://docs.microsoft.com/en-us/cpp/build/cmakesettings-reference?view=vs-2019 On 9/17/2019 10:00 AM, Juan Sanchez wrote: Hello, My impression that targeting 32 bit depends on what generator you are using.

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Juan Sanchez
Hello, My impression that targeting 32 bit depends on what generator you are using. https://cmake.org/cmake/help/git-stage/generator/Visual%20Studio%2015%202017.html It looks like cmake now has: - cmake -G "Visual Studio 15 2017" -A Win32 - cmake -G "Visual Studio 15 2017" -A x64 It used

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Albrecht Schlosser
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 mailto:sance...@numalliance.com>> escreveu: Hi, That first depends on which compiler you will use ? Regards, S.Ancelot Le 16/09/2019 à

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Joao Pedro Abreu De Souza
cl from visual studio 2017. Em ter, 17 de set de 2019 03:26, Stéphane Ancelot 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

Re: [CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-17 Thread Stéphane Ancelot
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

[CMake] toolchain file - cross-compiling windows-amd64->windows-x86

2019-09-16 Thread Joao Pedro Abreu De Souza
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