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. --- tests/BlockTypeRegistry/CMakeLists.txt | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'tests/BlockTypeRegistry') diff --git a/tests/BlockTypeRegistry/CMakeLists.txt b/tests/BlockTypeRegistry/CMakeLists.txt index ef4803747..b9036ffdf 100644 --- a/tests/BlockTypeRegistry/CMakeLists.txt +++ b/tests/BlockTypeRegistry/CMakeLists.txt @@ -1,5 +1,5 @@ find_package(Threads REQUIRED) -include_directories(${CMAKE_SOURCE_DIR}/src/) +include_directories(${PROJECT_SOURCE_DIR}/src/) # Define individual test executables: @@ -7,21 +7,21 @@ include_directories(${CMAKE_SOURCE_DIR}/src/) add_executable(BlockStateTest BlockStateTest.cpp ../TestHelpers.h - ${CMAKE_SOURCE_DIR}/src/BlockState.cpp - ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp + ${PROJECT_SOURCE_DIR}/src/BlockState.cpp + ${PROJECT_SOURCE_DIR}/src/StringUtils.cpp + ${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp ) target_link_libraries(BlockStateTest fmt::fmt) add_executable(BlockTypePaletteTest BlockTypePaletteTest.cpp ../TestHelpers.h - ${CMAKE_SOURCE_DIR}/src/BlockState.cpp - ${CMAKE_SOURCE_DIR}/src/BlockTypePalette.cpp - ${CMAKE_SOURCE_DIR}/src/JsonUtils.cpp - ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/File.cpp + ${PROJECT_SOURCE_DIR}/src/BlockState.cpp + ${PROJECT_SOURCE_DIR}/src/BlockTypePalette.cpp + ${PROJECT_SOURCE_DIR}/src/JsonUtils.cpp + ${PROJECT_SOURCE_DIR}/src/StringUtils.cpp + ${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp + ${PROJECT_SOURCE_DIR}/src/OSSupport/File.cpp ) target_link_libraries(BlockTypePaletteTest fmt::fmt jsoncpp_lib) @@ -29,9 +29,9 @@ target_link_libraries(BlockTypePaletteTest fmt::fmt jsoncpp_lib) add_executable(BlockTypeRegistryTest BlockTypeRegistryTest.cpp ../TestHelpers.h - ${CMAKE_SOURCE_DIR}/src/BlockTypeRegistry.cpp - ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp + ${PROJECT_SOURCE_DIR}/src/BlockTypeRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/StringUtils.cpp + ${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp ) target_link_libraries(BlockTypeRegistryTest fmt::fmt Threads::Threads) @@ -39,14 +39,14 @@ target_link_libraries(BlockTypeRegistryTest fmt::fmt Threads::Threads) add_executable(PalettedBlockAreaTest PalettedBlockAreaTest.cpp ../TestHelpers.h - ${CMAKE_SOURCE_DIR}/src/BlockState.cpp - ${CMAKE_SOURCE_DIR}/src/BlockTypeRegistry.cpp - ${CMAKE_SOURCE_DIR}/src/BlockTypePalette.cpp - ${CMAKE_SOURCE_DIR}/src/Cuboid.cpp - ${CMAKE_SOURCE_DIR}/src/JsonUtils.cpp - ${CMAKE_SOURCE_DIR}/src/PalettedBlockArea.cpp - ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp - ${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp + ${PROJECT_SOURCE_DIR}/src/BlockState.cpp + ${PROJECT_SOURCE_DIR}/src/BlockTypeRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/BlockTypePalette.cpp + ${PROJECT_SOURCE_DIR}/src/Cuboid.cpp + ${PROJECT_SOURCE_DIR}/src/JsonUtils.cpp + ${PROJECT_SOURCE_DIR}/src/PalettedBlockArea.cpp + ${PROJECT_SOURCE_DIR}/src/StringUtils.cpp + ${PROJECT_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp ) target_link_libraries(PalettedBlockAreaTest fmt::fmt jsoncpp_lib) -- cgit v1.2.3