diff --git a/xo-cmake/cmake/xo_macros/xo_cxx.cmake b/xo-cmake/cmake/xo_macros/xo_cxx.cmake index 4872043c..d6fb9369 100644 --- a/xo-cmake/cmake/xo_macros/xo_cxx.cmake +++ b/xo-cmake/cmake/xo_macros/xo_cxx.cmake @@ -1736,10 +1736,8 @@ function(xo_add_genfacetimpl) set(oneValueArgs TARGET # Name for this generation target FACET_PKG # package providing abstract interface - FACET_DIR # facet directory (instead of FACET_PKG) FACET # facet name INPUT # Input .json5 file - OUTPUT_IMPL_SUBDIR # Subdirectory name for impl headers ) set(multiValueArgs "") @@ -1754,25 +1752,23 @@ function(xo_add_genfacetimpl) if(NOT DEFINED GF_INPUT) message(FATAL_ERROR "xo_add_genfacetimpl: INPUT is required") endif() - if(NOT DEFINED GF_FACET_DIR) - if (NOT DEFINED GF_FACET_PKG) - message(FATAL_ERROR "xo_add_genfacetimpl: FACET_PKG or FACET_DIR required") - else() - # share_${GF_FACET_PKG} is a cmake target created by xo_add_shared_library4() - # or similar when a facet-provider (e.g. xo-gc) builds from source in the same - # cmake context (XO_SUBMODULE_BUILD=True). - # - # It is NOT exported in the installed cmake - # config, so it won't exist when the facet package is consumed as an installed - # dependency (e.g. in a standalone nix build). - # - if(NOT TARGET share_${GF_FACET_PKG}) - message(STATUS "xo_add_genfacetimpl: share_${GF_FACET_PKG} not available; skipping ${GF_TARGET}") - return() - endif() - get_target_property(_facet_dir share_${GF_FACET_PKG} path) - set(GF_FACET_DIR ${_facet_dir}) + if (NOT DEFINED GF_FACET_PKG) + message(FATAL_ERROR "xo_add_genfacetimpl: FACET_PKG required") + else() + # share_${GF_FACET_PKG} is a cmake target created by xo_add_shared_library4() + # or similar when a facet-provider (e.g. xo-gc) builds from source in the same + # cmake context (XO_SUBMODULE_BUILD=True). + # + # It is NOT exported in the installed cmake + # config, so it won't exist when the facet package is consumed as an installed + # dependency (e.g. in a standalone nix build). + # + if(NOT TARGET share_${GF_FACET_PKG}) + message(FATAL_ERROR "xo_add_genfacetimpl: share_${GF_FACET_PKG} not available; skipping ${GF_TARGET}") + return() endif() + get_target_property(_facet_dir share_${GF_FACET_PKG} path) + set(GF_FACET_DIR ${_facet_dir}) endif() find_program(GENFACET_EXECUTABLE NAMES genfacet