mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Merge pull request #1728 from enetheru/default_target
CMake: template_debug as default target when godot-cpp is top level
This commit is contained in:
@@ -36,11 +36,17 @@ function is run.
|
|||||||
|
|
||||||
The CMake equivalent is below.
|
The CMake equivalent is below.
|
||||||
]=======================================================================]
|
]=======================================================================]
|
||||||
|
|
||||||
include(cmake/godotcpp.cmake)
|
include(cmake/godotcpp.cmake)
|
||||||
|
|
||||||
godotcpp_options()
|
godotcpp_options()
|
||||||
|
|
||||||
|
#[[ People are compiling godot by itself and expecting template_debug
|
||||||
|
Replace this with PROJECT_IS_TOP_LEVEL, <PROJECT-NAME>_IS_TOP_LEVEL when minimum reaches 3.21
|
||||||
|
]]
|
||||||
|
if(NOT PROJECT_NAME)
|
||||||
|
set(GODOTCPP_IS_TOP_LEVEL ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Define our project.
|
# Define our project.
|
||||||
project(
|
project(
|
||||||
godot-cpp
|
godot-cpp
|
||||||
|
|||||||
@@ -330,8 +330,17 @@ function(godotcpp_generate)
|
|||||||
"$<$<NOT:${THREADS_ENABLED}>:.nothreads>"
|
"$<$<NOT:${THREADS_ENABLED}>:.nothreads>"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# People are compiling godot by itself.
|
||||||
|
set(EXCLUDE EXCLUDE_FROM_ALL)
|
||||||
|
if(GODOTCPP_IS_TOP_LEVEL)
|
||||||
|
if(TARGET_ALIAS STREQUAL template_debug)
|
||||||
|
set(EXCLUDE "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# the godot-cpp.* library targets
|
# the godot-cpp.* library targets
|
||||||
add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL)
|
add_library(${TARGET_NAME} STATIC ${EXCLUDE})
|
||||||
|
|
||||||
add_library(godot-cpp::${TARGET_ALIAS} ALIAS ${TARGET_NAME})
|
add_library(godot-cpp::${TARGET_ALIAS} ALIAS ${TARGET_NAME})
|
||||||
|
|
||||||
file(GLOB_RECURSE GODOTCPP_SOURCES LIST_DIRECTORIES NO CONFIGURE_DEPENDS src/*.cpp)
|
file(GLOB_RECURSE GODOTCPP_SOURCES LIST_DIRECTORIES NO CONFIGURE_DEPENDS src/*.cpp)
|
||||||
|
|||||||
Reference in New Issue
Block a user