@@ -161,6 +161,25 @@ function( godotcpp_options )
161161
162162 # Enable Testing 
163163 option ( GODOTCPP_ENABLE_TESTING "Enable the godot-cpp.test.<target> integration testing targets"  OFF  )
164+  # Define which targets create for build. By default all targets are included 
165+  # Not presented in SCons 
166+  option (GODOTCPP_ADD_TARGET_TEMPLATE_RELEASE "Add template_release target to build"  ON )
167+  option (GODOTCPP_ADD_TARGET_TEMPLATE_DEBUG "Add template_debug target to build"  ON )
168+  option (GODOTCPP_ADD_TARGET_EDITOR "Add editor target to build"  ON )
169+  if (GODOTCPP_ADD_TARGET_TEMPLATE_DEBUG)
170+  list (APPEND  GODOTCPP_TARGETS "template_debug" )
171+  endif ()
172+  if (GODOTCPP_ADD_TARGET_TEMPLATE_RELEASE)
173+  list (APPEND  GODOTCPP_TARGETS "template_release" )
174+  endif ()
175+  if (GODOTCPP_ADD_TARGET_EDITOR)
176+  list (APPEND  GODOTCPP_TARGETS "editor" )
177+  endif ()
178+  if (NOT  GODOTCPP_TARGETS)
179+  message (FATAL_ERROR "No targets were chosen to be build.See GODOTCPP_ADD_TARGET_* variables: at least one of the should be ON" )
180+  endif ()
181+  # parent scoping GODOTCPP_TARGETS 
182+  set (GODOTCPP_TARGETS ${GODOTCPP_TARGETS}  PARENT_SCOPE)
164183
165184 #[[ Target Platform Options ]] 
166185 android_options()
@@ -288,7 +307,7 @@ function( godotcpp_generate )
288307 set ( IS_DEV_BUILD "$<BOOL:${GODOTCPP_DEV_BUILD} >" )
289308
290309 ### Define our godot-cpp library targets 
291-  foreach  ( TARGET_ALIAS template_debug template_release editor  )
310+  foreach  ( TARGET_ALIAS ${GODOTCPP_TARGETS}  )
292311 set ( TARGET_NAME "godot-cpp.${TARGET_ALIAS} "  )
293312
294313 # Generator Expressions that rely on the target 
0 commit comments