From 532731e6f4c0d843d355ff8f2d9f63e4e7854e6a Mon Sep 17 00:00:00 2001 From: bibo38 Date: Thu, 21 Dec 2017 12:36:58 +0100 Subject: Fixed Clang 5.0 compile errors (#4085) * Fixed Clang 5.0 compile errors * Fixed wrong comment * Only disable warnings in Clang 5 or higher * Added a CMake condition for the Clang 5 no-zero-as-null-pointer-constant warning * Now using the use_nullptr branch of the Cuberite specific SQLiteCpp fork --- src/Bindings/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Bindings/CMakeLists.txt') diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt index 0cfb7add9..45bd573d5 100644 --- a/src/Bindings/CMakeLists.txt +++ b/src/Bindings/CMakeLists.txt @@ -167,8 +167,11 @@ set_source_files_properties(${BINDING_OUTPUTS} PROPERTIES GENERATED TRUE) set_source_files_properties(${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp PROPERTIES COMPILE_FLAGS -Wno-error) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(Bindings.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS} "-Wno-old-style-cast -Wno-missing-prototypes") +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) # Workaround for VERSION_GREATER_EQUAL, which is only supported on CMake 3.7+ + set(ADDITIONAL_FLAGS "-Wno-zero-as-null-pointer-constant") + endif() + set_source_files_properties(Bindings.cpp PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast -Wno-missing-prototypes ${ADDITIONAL_FLAGS}") endif() if(NOT MSVC) -- cgit v1.2.3