From 4e869a29747ed589e9c431ebb99436d67f3ffd74 Mon Sep 17 00:00:00 2001 From: Koncord Date: Fri, 16 Feb 2018 16:31:45 +0800 Subject: [PATCH] [General] Use correct versions of C++ per target C++11 for client, components and launcher C++14 for server, browser and masterserver --- CMakeLists.txt | 3 +-- apps/browser/CMakeLists.txt | 5 ++--- apps/master/CMakeLists.txt | 5 ++--- apps/openmw-mp/CMakeLists.txt | 3 ++- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 048d7466c..d2c98eba2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,8 +376,7 @@ if (NOT WIN32 AND NOT APPLE) endif() # CXX Compiler settings -# tes3mp's server requires C++14 -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 11) if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wno-unused-parameter -std=c++11 -pedantic -Wno-long-long") add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) diff --git a/apps/browser/CMakeLists.txt b/apps/browser/CMakeLists.txt index 4da184e92..83e3ac7ad 100644 --- a/apps/browser/CMakeLists.txt +++ b/apps/browser/CMakeLists.txt @@ -1,6 +1,3 @@ - -set (CMAKE_CXX_STANDARD 14) - set(BROWSER_UI ${CMAKE_SOURCE_DIR}/files/tes3mp/ui/Main.ui ${CMAKE_SOURCE_DIR}/files/tes3mp/ui/ServerInfo.ui @@ -75,6 +72,8 @@ add_executable(tes3mp-browser ${UI_HDRS} ) +set_property(TARGET tes3mp-browser PROPERTY CXX_STANDARD 14) + if (WIN32) INSTALL(TARGETS tes3mp-browser RUNTIME DESTINATION ".") endif (WIN32) diff --git a/apps/master/CMakeLists.txt b/apps/master/CMakeLists.txt index e92bd7a2b..59fe12812 100644 --- a/apps/master/CMakeLists.txt +++ b/apps/master/CMakeLists.txt @@ -1,8 +1,5 @@ project(masterserver) -#set(CMAKE_CXX_STANDARD 14) -add_definitions(-std=gnu++14) - include_directories("./") set(SOURCE_FILES main.cpp MasterServer.cpp MasterServer.hpp RestServer.cpp RestServer.hpp AdminRest.cpp) @@ -10,6 +7,8 @@ set(SOURCE_FILES main.cpp MasterServer.cpp MasterServer.hpp RestServer.cpp RestS add_executable(masterserver ${SOURCE_FILES}) target_link_libraries(masterserver ${RakNet_LIBRARY} ${LuaJit_LIBRARIES} ${OPENSSL_LIBRARIES} components) +set_property(TARGET masterserver PROPERTY CXX_STANDARD 14) + option(BUILD_MASTER_TEST "build master server test program" OFF) if(BUILD_MASTER_TEST) diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index f835409ce..b8e445720 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -133,8 +133,9 @@ target_compile_definitions(tes3mp-server PRIVATE $<$:SOL_SAFE_FUNC target_compile_definitions(tes3mp-server PRIVATE $<$:SOL_SAFE_USERTYPE> $<$:SOL_SAFE_USERTYPE>) target_compile_definitions(tes3mp-server PRIVATE $<$:SERVER_DEBUG> $<$:SERVER_DEBUG>) +set_property(TARGET tes3mp-server PROPERTY CXX_STANDARD 14) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(tes3mp-server PRIVATE -std=gnu++14 -Wno-ignored-qualifiers -ftemplate-depth=2048) + target_compile_options(tes3mp-server PRIVATE -Wno-ignored-qualifiers -ftemplate-depth=2048) endif() target_link_libraries(tes3mp-server