From b197d23ad78d30c04071892bdd32b1033df7be27 Mon Sep 17 00:00:00 2001 From: Samuel Nicholas Date: Thu, 19 Sep 2024 08:10:22 +0930 Subject: [PATCH] Renamed GodotCompilerWarnings.cmake to common_compiler_flags.cmake to match scons Included files explicitly by path, as we dont need to append to the CMAKE_MODULES_PATH which effects the whole build tree. This prevents consumers of the library from clobbering the names of the cmake include files and breaking the build. --- CMakeLists.txt | 4 +--- ...odotCompilerWarnings.cmake => common_compiler_flags.cmake} | 0 cmake/godotcpp.cmake | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) rename cmake/{GodotCompilerWarnings.cmake => common_compiler_flags.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbad36986..ff77368ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) endif () endif () -# Add path to modules -list( APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" ) -include( godotcpp ) +include( ${PROJECT_SOURCE_DIR}/cmake/godotcpp.cmake ) # I know this doesn't look like a typical CMakeLists.txt, but as we are # attempting mostly feature parity with SCons, and easy maintenance, the closer diff --git a/cmake/GodotCompilerWarnings.cmake b/cmake/common_compiler_flags.cmake similarity index 100% rename from cmake/GodotCompilerWarnings.cmake rename to cmake/common_compiler_flags.cmake diff --git a/cmake/godotcpp.cmake b/cmake/godotcpp.cmake index b50bcbca7..a5c667796 100644 --- a/cmake/godotcpp.cmake +++ b/cmake/godotcpp.cmake @@ -167,7 +167,7 @@ function( godotcpp_generate ) ) add_library(godot::cpp ALIAS ${PROJECT_NAME}) - include(GodotCompilerWarnings) + include(${PROJECT_SOURCE_DIR}/cmake/common_compiler_flags.cmake) target_compile_features(${PROJECT_NAME} PRIVATE