cmake build: + xo-genfacet-all target for umbrella build

This commit is contained in:
Roland Conybeare 2026-03-11 09:14:30 -05:00
commit bee320e09b
2 changed files with 20 additions and 0 deletions

View file

@ -143,6 +143,11 @@ add_subdirectory(xo-interpreter)
#
add_subdirectory(xo-imgui)
# ----------------------------------------------------------------
# umbrella-wide facet code generation
xo_umbrella_genfacet_all(xo-genfacet-all)
# ----------------------------------------------------------------
# documentation. must follow add_subdirectory() for satellite projects

View file

@ -1806,7 +1806,22 @@ function(xo_add_genfacet_all target_name)
get_property(genfacet_targets DIRECTORY PROPERTY XO_GENFACET_TARGETS)
if(genfacet_targets)
add_custom_target(${target_name} DEPENDS ${genfacet_targets})
if(XO_SUBMODULE_BUILD)
set_property(GLOBAL APPEND PROPERTY XO_UMBRELLA_GENFACET_TARGETS ${target_name})
endif()
else()
message(WARNING "xo_add_genfacet_all: no genfacet targets found")
endif()
endfunction()
# create umbrella target that depends on all per-satellite genfacet-all targets.
# only meaningful in umbrella build (XO_SUBMODULE_BUILD=True).
function(xo_umbrella_genfacet_all target_name)
get_property(all_targets GLOBAL PROPERTY XO_UMBRELLA_GENFACET_TARGETS)
if(all_targets)
add_custom_target(${target_name} DEPENDS ${all_targets})
else()
message(WARNING "xo_umbrella_genfacet_all: no umbrella genfacet targets found")
endif()
endfunction()