- Detecting 32 bit system Windows systems and auto-setting -m32 (Currently checking for ProgramFiles(x86) env var)
- Built output will be in e.g. release.win32, not release.win32.x32 as ARCH is set after ARCH_SUFFIX
- GDB executable used on Windows has been updated to match executables supplied with the installer:
'i686-w64-mingw32-gdb' for the 32 bit version, 'gdb' for the 64 bit version
endif
+# On Windows/32 bit systems, pass -m32 as TDM-GCC packaged with the installer produces 64 bit executables by default
+# Disable this if your compiler does not accept -m32
+ifndef ARCH
+ ifeq "$(HOST_PLATFORM)" "win32"
+ ifeq "$(TARGET_PLATFORM)" "win32"
+ ifndef ProgramFiles(x86)
+ ARCH := x32
+ TARGET_ARCH := i386
+ ARCH_FLAGS := -m32
+ endif
+ endif
+ endif
+endif
+
# DEBUG SUFFIX
ifdef DEBUG
DEBUG_SUFFIX := .debug
if(result)
{
- strcpy(command,
- (compiler.targetPlatform == win32 && bitDepth == 64) ? "x86_64-w64-mingw32-gdb" :
- (compiler.targetPlatform == win32 && bitDepth == 32) ? "i686-w64-mingw32-gdb" :
- "gdb");
+ if(compiler.targetPlatform == win32)
+ {
+ strcpy(command,
+#if !((defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__))
+ 1 ||
+#endif
+ bitDepth == 32 ? "i686-w64-mingw32-gdb" : "gdb"); // x86_64-w64-mingw32-gdb
+ }
+ else
+ // We really should have a box to select GDB in the compiler/toolchain options
+ strcpy(command, "gdb");
if(!CheckCommandAvailable(command))
{
ide.outputView.debugBox.Logf($"Debugger Fatal Error: Command %s for GDB is not available.\n", command);