From 57009f6467f6d7bee4ec9bff392a113e7199a23c Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Sat, 18 Mar 2017 02:11:09 +0100 Subject: [PATCH] Generator expressions using COMPILE_LANGUAGE are only available from 3.3 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e458d924..de1590098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,7 @@ generate_source("src/game/generated/server_data.h" "server_content_header") # Sources file(GLOB_RECURSE BASE "src/base/*.c" "src/base/*.cpp" "src/base/*.h") -file(GLOB_RECURSE ENGINE_SHARED "src/engine/shared/*.cpp" "src/engine/shared/*.h") +file(GLOB_RECURSE ENGINE_SHARED "src/engine/shared/*.cpp" "src/engine/shared/*.h") file(GLOB GAME_SHARED "src/game/*.cpp" "src/game/*.h") set(GAME_GENERATED_SHARED "src/game/generated/protocol.cpp" "src/game/generated/protocol.h" "src/game/generated/nethash.cpp") @@ -442,7 +442,9 @@ foreach(target ${TARGETS_OWN}) target_compile_options(${target} PRIVATE /wd4800) # Implicit conversion of int to bool. elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU) target_compile_options(${target} PRIVATE -Wall) - target_compile_options(${target} PRIVATE $<$:-Wdeclaration-after-statement>) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.3) + target_compile_options(${target} PRIVATE $<$:-Wdeclaration-after-statement>) + endif() #target_compile_options(${target} PRIVATE -Wextra) #target_compile_options(${target} PRIVATE -Wformat=2) # Warn about format strings. endif()