mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 04:10:24 +00:00
Avoid D9025 warning by not adding /W3 by default using CMP0092 policy
See https://gitlab.kitware.com/cmake/cmake/-/issues/18317 Set policies before declaring the project otherwise they might not take effect. Specifically CMP0092 does not have effect added after project.
This commit is contained in:
parent
81e1d72c64
commit
a40ec4edd6
1 changed files with 15 additions and 8 deletions
|
@ -1,9 +1,4 @@
|
||||||
project(OpenMW)
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
cmake_minimum_required(VERSION 3.1.0)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
# for link time optimization, remove if cmake version is >= 3.9
|
# for link time optimization, remove if cmake version is >= 3.9
|
||||||
if(POLICY CMP0069) # LTO
|
if(POLICY CMP0069) # LTO
|
||||||
|
@ -20,6 +15,18 @@ if(POLICY CMP0079)
|
||||||
cmake_policy(SET CMP0079 NEW)
|
cmake_policy(SET CMP0079 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# don't add /W3 flag by default for MSVC
|
||||||
|
if(POLICY CMP0092)
|
||||||
|
cmake_policy(SET CMP0092 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(OpenMW)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
option(OPENMW_GL4ES_MANUAL_INIT "Manually initialize gl4es. This is more reliable on platforms without a windowing system. Requires gl4es to be configured with -DNOEGL=ON -DNO_LOADER=ON -DNO_INIT_CONSTRUCTOR=ON." OFF)
|
option(OPENMW_GL4ES_MANUAL_INIT "Manually initialize gl4es. This is more reliable on platforms without a windowing system. Requires gl4es to be configured with -DNOEGL=ON -DNO_LOADER=ON -DNO_INIT_CONSTRUCTOR=ON." OFF)
|
||||||
if(OPENMW_GL4ES_MANUAL_INIT)
|
if(OPENMW_GL4ES_MANUAL_INIT)
|
||||||
add_definitions(-DOPENMW_GL4ES_MANUAL_INIT)
|
add_definitions(-DOPENMW_GL4ES_MANUAL_INIT)
|
||||||
|
|
Loading…
Reference in a new issue