From e979c27cc7ee25671d41b74a8f984c6193601526 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 10 Jun 2015 21:34:45 -0500 Subject: Prevent CFLAGS and CXXFLAGS from being set when using CMake wrappers Based on mingw-filesystem commit 7daa0102535b1ab53bc40d97bb5aa0e30489e00e. --- cygwin-filesystem.spec | 1 + cygwin-scripts.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cygwin-filesystem.spec b/cygwin-filesystem.spec index b7d8df2..e826334 100644 --- a/cygwin-filesystem.spec +++ b/cygwin-filesystem.spec @@ -251,6 +251,7 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/cygwin/ - Add CMAKE_SYSTEM_PROCESSOR to the CMake toolchain files - Allow verbose CMake output to be disabled - Don't use verbose output by default in the CMake wrapper scripts +- Prevent CFLAGS and CXXFLAGS from being set when using CMake wrappers * Thu Jun 11 2015 Yaakov Selkowitz - 12-1 - Add cppflags, ldflags variables diff --git a/cygwin-scripts.sh b/cygwin-scripts.sh index ef2345a..1a0324f 100755 --- a/cygwin-scripts.sh +++ b/cygwin-scripts.sh @@ -30,6 +30,15 @@ else NAME="`basename $0|tr -- - _`" fi +# When using the CMake wrappers, prevent CFLAGS and CXXFLAGS from being set +# unless they're already set in the current environment (RHBZ #1136069) +if [[ $NAME == *cmake* ]] ; then + CYGWIN32_CFLAGS=${CYGWIN32_CFLAGS:-""} + CYGWIN32_CXXFLAGS=${CYGWIN32_CXXFLAGS:-""} + CYGWIN64_CFLAGS=${CYGWIN64_CFLAGS:-""} + CYGWIN64_CXXFLAGS=${CYGWIN64_CXXFLAGS:-""} +fi + # NOTE: The use of 'eval' in combination with '$@' is a potential security risk # We should find a more safe replacement for this command # Suggestions are welcome at the Fedora MinGW mailing list -- cgit