summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2016-08-11 16:10:23 (GMT)
committerTony Theodore <tonyt@logyst.com>2016-08-11 16:19:40 (GMT)
commite66f2a9e9d516f813e140d6b3200036473484bb5 (patch)
tree2bf9dea29e7acb50b7c743f1fb2cd70a2dcefcdf /src
parentc7218bfbc45d182e59ba3c3543cde6e591fbe92a (diff)
downloadmxe-e66f2a9e9d516f813e140d6b3200036473484bb5.zip
mxe-e66f2a9e9d516f813e140d6b3200036473484bb5.tar.gz
mxe-e66f2a9e9d516f813e140d6b3200036473484bb5.tar.bz2
cmake: fix windres invocation
Windres doesn't recognise various gcc flags like `-mms-bitfields`, `-fopenmp`, `-mthreads` etc. (basically anything not `-D` or `-I`). CMake will filter options if `add_compile_options()` is used, but not for `add_definitions()`. The developers class it as a "won't fix" as they believe `add_definitions()` shouldn't be used for such flags. Fixes #1475
Diffstat (limited to 'src')
-rw-r--r--src/cmake-1-fixes.patch20
-rw-r--r--src/mxe-conf.mk4
2 files changed, 23 insertions, 1 deletions
diff --git a/src/cmake-1-fixes.patch b/src/cmake-1-fixes.patch
new file mode 100644
index 0000000..918a297
--- /dev/null
+++ b/src/cmake-1-fixes.patch
@@ -0,0 +1,20 @@
+This file is part of MXE.
+See index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore <tonyt@logyst.com>
+Date: Fri, 12 Aug 2016 02:01:20 +1000
+Subject: [PATCH] fix windres invocation options
+
+windres doesn't recognise various gcc flags like -mms-bitfields,
+-fopenmp, -mthreads etc. (basically not `-D` or `-I`)
+
+diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake
+index 1111111..2222222 100644
+--- a/Modules/Platform/Windows-windres.cmake
++++ b/Modules/Platform/Windows-windres.cmake
+@@ -1 +1 @@
+-set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>")
++set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <SOURCE> <OBJECT>")
diff --git a/src/mxe-conf.mk b/src/mxe-conf.mk
index 83a92b0..fa36c08 100644
--- a/src/mxe-conf.mk
+++ b/src/mxe-conf.mk
@@ -20,6 +20,9 @@ define $(PKG)_BUILD
# create the CMake toolchain file
# individual packages (e.g. hdf5) should add their
# own files under CMAKE_TOOLCHAIN_DIR
+ # CMAKE_RC_COMPILE_OBJECT is defined in:
+ # <cmake root>/share/cmake-X.Y/Modules/Platform/Windows-windres.cmake
+
mkdir -p '$(CMAKE_TOOLCHAIN_DIR)'
touch '$(CMAKE_TOOLCHAIN_DIR)/.gitkeep'
(echo 'set(CMAKE_SYSTEM_NAME Windows)'; \
@@ -39,7 +42,6 @@ define $(PKG)_BUILD
echo 'set(CMAKE_INSTALL_PREFIX $(PREFIX)/$(TARGET) CACHE PATH "Installation Prefix")'; \
echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel")'; \
echo 'set(CMAKE_CROSS_COMPILING ON) # Workaround for http://www.cmake.org/Bug/view.php?id=14075'; \
- echo 'set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>") # Workaround for buggy windres rules'; \
echo ''; \
echo 'file(GLOB mxe_cmake_files'; \
echo ' "$(CMAKE_TOOLCHAIN_DIR)/*.cmake"'; \