Building x64 version with MinGW-w64 #1

teepean opened this Issue Jan 18, 2012 · 6 comments

2 participants


I am trying to build x64 version of Doom 3 on Windows but cmake seems to insist on building the x86 version. Are there any command line options I can use to force the x86_64 build?

dhewm member

Depends on how that toolchain was built and how you access it.
If its just another prefix (like "x86_64-w64-mingw32-g++" instead of "g++") you can feed CC and CXX to cmake via envvars.
What I do is to use a cmake toolchain file, which I described in the README.

@dhewg dhewg was assigned Jan 18, 2012

Ok, thanks a lot. I usually use MSYS for building but decided to use CMD instead and that caused the problems.

@teepean teepean closed this Jan 18, 2012
dhewm member

Okay, nice ;)

Anything else you had to do to make it compile (I only cross compile it from Linux)? Something that might be of help to others or that I could maybe describe in the README?


I used following Toolchain.cmake. As I don't have cross-compiler cmake couldn't find ar so I had to add CMAKE_AR to point to correct file. Forward slash in CMAKE_FIND_ROOT_PATH is very important as configuration will fail with backslash! Compilation went ok with some warnings (GCC 4.6.2) and the game starts and seems to be working.

set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc.exe)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++.exe)
set(CMAKE_RC_COMPILER windres)
set(CMAKE_AR ar)
set(CMAKE_FIND_ROOT_PATH l:/mingw64)

@teepean teepean reopened this Jan 18, 2012
dhewm member

Ok, thanks.
I think mingw 64bit is the least tested, so please feel free to open issues about anything you run into ;)

@dhewg dhewg closed this Jan 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment