From a145980795a4f37ebb9857bddb7427a184bbd6dd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 15 Oct 2020 10:35:44 +0100 Subject: Fix Android builds (#4998) Construct paths relative to the Cuberite sources with PROJECT_SOURCE_DIR, instead of wherever the first CMakeLists.txt file happened to be with CMAKE_SOURCE_DIR. In Android's case, the latter was in a folder called android/ but that's not the root of the source tree, so any file path built off that root was wrong. This caused file-specific warnings exclusions to fail to apply. --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bd7c1941..da77aed5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,13 +88,10 @@ endif() # Selectively disable warnings in the level where the target is created: if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Generated file has old-style casts, missing prototypes, and deprecated declarations - set_source_files_properties("${CMAKE_SOURCE_DIR}/src/Bindings/Bindings.cpp" PROPERTIES COMPILE_OPTIONS -Wno-everything) + set_source_files_properties("${PROJECT_SOURCE_DIR}/src/Bindings/Bindings.cpp" PROPERTIES COMPILE_OPTIONS -Wno-everything) # File failed to follow NHS guidelines on handwashing and has not maintained good hygiene - set_source_files_properties("${CMAKE_SOURCE_DIR}/src/IniFile.cpp" PROPERTIES COMPILE_OPTIONS -Wno-header-hygiene) - - # Enforce BlockHandler handling all blocks in switch statements - set_source_files_properties("${CMAKE_SOURCE_DIR}/src/Blocks/BlockHandler.cpp" PROPERTIES COMPILE_OPTIONS -Werror=switch) + set_source_files_properties("${PROJECT_SOURCE_DIR}/src/IniFile.cpp" PROPERTIES COMPILE_OPTIONS -Wno-header-hygiene) endif() if(${BUILD_TOOLS}) -- cgit v1.2.3