Merge pull request #1717 from LuaAndC/cmake-release-in-script

support overriding CMAKE_BUILD_TYPE in cmdline
This commit is contained in:
Tony Theodore 2017-03-16 00:04:27 +11:00 committed by GitHub
commit a3e0b6a341
2 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,6 @@ endif()
## General configuration
set(CMAKE_SYSTEM_NAME Windows)
set(MSYS 1)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel" FORCE)
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
# Workaround for https://www.cmake.org/Bug/view.php?id=14075
set(CMAKE_CROSS_COMPILING ON)

View File

@ -18,6 +18,10 @@ else
echo " - warnings for unused CMAKE_POLICY_DEFAULT variables can be ignored"
echo "== Using MXE toolchain: @CMAKE_TOOLCHAIN_FILE@"
echo "== Using MXE runresult: @CMAKE_RUNRESULT_FILE@"
if ! ( echo "$@" | grep --silent "DCMAKE_BUILD_TYPE" ) ; then
echo '== Adding "-DCMAKE_BUILD_TYPE=Release"'
set -- "-DCMAKE_BUILD_TYPE=Release" "$@"
fi
exec "@PREFIX@/@BUILD@/bin/cmake" \
-DCMAKE_TOOLCHAIN_FILE="@CMAKE_TOOLCHAIN_FILE@" \
`eval echo -DCMAKE_POLICY_DEFAULT_CMP{$POLICIES}=NEW` \