Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake + MinGW Makefiles #143

Open
brandonros opened this issue Jan 22, 2022 · 1 comment
Open

cmake + MinGW Makefiles #143

brandonros opened this issue Jan 22, 2022 · 1 comment

Comments

@brandonros
Copy link

Here is how I usually compile when I am on Windows:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" # to load the necessary MSBuild and all that
cmake -A Win32 -S . -B "Win32" && cmake --build Win32 --config Debug

Would it be easy to be able to do this with docker-wine?

https://github.com/dockcross/dockcross tries to do this but it doesn't work very well.

#!/bin/bash

init_compile () {
  if [ ! -f ~/dockcross-windows-shared-x86 ]
  then
    docker run --rm dockcross/windows-shared-x86 > ~/dockcross-windows-shared-x86
    chmod +x ~/dockcross-windows-shared-x86
  fi
}

compile () {
  ~/dockcross-windows-shared-x86 bash -c 'cmake -D CMAKE_C_COMPILER="/usr/src/mxe/usr/bin/i686-w64-mingw32.shared-gcc" -D CMAKE_CXX_COMPILER="/usr/src/mxe/usr/bin/i686-w64-mingw32.shared-g++" -A Win32 -S . -B "Win32" && cmake --build Win32 --config Debug'
}

init_compile
compile
$ ./compile-ia32.sh 
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
== Using MXE wrapper: /usr/src/mxe/usr/bin/i686-w64-mingw32.shared-cmake
     - cmake version 3.20.1
     - warnings for unused CMAKE_POLICY_DEFAULT variables can be ignored
== Using MXE toolchain: /usr/src/mxe/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake
== Using MXE runresult: /usr/src/mxe/usr/share/cmake/modules/TryRunResults.cmake
== Adding "-DCMAKE_BUILD_TYPE=Release"
loading initial cache file /usr/src/mxe/usr/share/cmake/modules/TryRunResults.cmake
CMake Error at CMakeLists.txt:2 (project):
  Generator

    Unix Makefiles

  does not support platform specification, but platform

    Win32

  was specified.


-- Configuring incomplete, errors occurred!
See also "/work/Win32/CMakeFiles/CMakeOutput.log".

@brandonros brandonros changed the title cmake + MSVC cmake + MinGW Makefiles Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant