@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.21)
3
3
set (PROJECT_NAME EnigmaFix )
4
4
# Set the name of the target operating system.
5
5
set (CMAKE_SYSTEM_NAME Windows )
6
+ set (MINGW_TOOLCHAIN_PREFIX x86_64-w64-mingw32 )
6
7
7
8
if (UNIX ) # If compiling on Linux, manually configure MingW-64.
8
9
# Try to get NAME by checking for NixOS in /etc/os-release
@@ -19,12 +20,14 @@ if (UNIX) # If compiling on Linux, manually configure MingW-64.
19
20
# NOTE: We might not even need to adjust the CMAKE_FIND_ROOT_PATH on NixOS, at least with development toolchains.
20
21
else ()
21
22
# Set the Toolchain to MinGW on Linux.
22
- set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 )
23
+ set (CMAKE_FIND_ROOT_PATH /usr/${MINGW_TOOLCHAIN_PREFIX} )
23
24
link_directories (${CMAKE_FIND_ROOT_PATH} /sys-root/mingw/lib ) # TODO: Fix to also work with MinGW on Windows.
24
25
message (STATUS "This system is not NixOS. It is: ${NAME} . Root Path declaration is necessary." )
25
26
endif ()
26
- set (CMAKE_C_COMPILER x86_64-w64-mingw32-gcc )
27
- set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ )
27
+
28
+ set (CMAKE_C_COMPILER ${MINGW_TOOLCHAIN_PREFIX} -gcc )
29
+ set (CMAKE_CXX_COMPILER ${MINGW_TOOLCHAIN_PREFIX} -g++ )
30
+ set (CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX} -windres )
28
31
# adjust the default behavior of the FIND_XXX() commands:
29
32
# Never search for programs in the host environment
30
33
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
0 commit comments