Skip to content

Commit

Permalink
Make the lists of targets an option
Browse files Browse the repository at this point in the history
Currently godot-cpp build-times is 3x, due to building all 3 targets
By allowing users to specify which targets they want,
don't have to pay for unecessary builds
  • Loading branch information
ytnuf committed Nov 24, 2024
1 parent c2fbef6 commit af566f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/godotcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ function( godotcpp_options )
option( GODOT_DEBUG_SYMBOLS "" OFF )
option( GODOT_DEV_BUILD "Developer build with dev-only debugging code (DEV_ENABLED)" OFF )

set(GODOT_TARGETS template_debug;template_release;editor CACHE STRING "Compilation targets")

# FIXME These options are not present in SCons, and perhaps should be added there.
option( GODOT_SYSTEM_HEADERS "Expose headers as SYSTEM." OFF )
option( GODOT_WARNING_AS_ERROR "Treat warnings as errors" OFF )
Expand Down Expand Up @@ -226,7 +228,7 @@ function( godotcpp_generate )
endif()

### Define our godot-cpp library targets
foreach ( TARGET_NAME template_debug template_release editor )
foreach(TARGET_NAME IN LISTS GODOT_TARGETS)

# Useful genex snippits used in subsequent genex's
set( IS_RELEASE "$<STREQUAL:${TARGET_NAME},template_release>")
Expand Down

0 comments on commit af566f3

Please sign in to comment.