chore(.appveyor.yml,src/CMakeLists): make cxx and linker flags configurable and use them to disable slow LTO on AppVeyor
This commit is contained in:
parent
340e056dee
commit
29d1911f50
2 changed files with 11 additions and 5 deletions
|
|
@ -15,7 +15,13 @@ install:
|
|||
build_script:
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
- cd %APPVEYOR_BUILD_FOLDER% && mkdir build && cd build
|
||||
- if %CFG% == MSVC (cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -G "NMake Makefiles" &&
|
||||
# disable slow LTO
|
||||
- if %CFG% == MSVC (cmake ../src
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
-DLEAN_EXTRA_CXX_FLAGS=/GL-
|
||||
-DLEAN_EXTRA_LINKER_FLAGS_MSVC=/LTCG:OFF
|
||||
-G "NMake Makefiles" &&
|
||||
cmake --build .)
|
||||
- if %CFG% == MINGW64 (C:\msys64\usr\bin\bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER/build &&
|
||||
OPTIONS='';
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ set(LEAN_VERSION_PATCH 1)
|
|||
set(LEAN_VERSION_IS_RELEASE 0) # This number is 1 in the release revision, and 0 otherwise.
|
||||
set(LEAN_VERSION_STRING "${LEAN_VERSION_MAJOR}.${LEAN_VERSION_MINOR}.${LEAN_VERSION_PATCH}" CACHE STRING "Lean version string")
|
||||
|
||||
set(LEAN_EXTRA_LINKER_FLAGS "")
|
||||
set(LEAN_EXTRA_CXX_FLAGS "")
|
||||
set(LEAN_EXTRA_LINKER_FLAGS "" CACHE STRING "Additional flags used by the linker")
|
||||
set(LEAN_EXTRA_CXX_FLAGS "" CACHE STRING "Additional flags used by the C++ compiler")
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "No build type selected, default to Release")
|
||||
|
|
@ -253,8 +253,8 @@ elseif (MSVC)
|
|||
set(CMAKE_CXX_FLAGS_MINSIZEREL "/Os /Zc:inline ${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Oi /Oy /Zc:inline ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Oi /Zi ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} /LTCG:INCREMENTAL")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG:INCREMENTAL")
|
||||
set(LEAN_EXTRA_LINKER_FLAGS "/LTCG:INCREMENTAL ${LEAN_EXTRA_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${LEAN_EXTRA_LINKER_FLAGS}")
|
||||
elseif (EMSCRIPTEN)
|
||||
message(STATUS "Emscripten is detected: Make sure the wraped compiler supports C++11")
|
||||
else()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue