Files
WoW-Hybrid-gateway/cmake/ItemBuildBase.cmake
T
praxisandClaude Fable 5.2 ade859f153 Project overview, working rules and build system
11 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:47 +02:00

38 lines
2.4 KiB
CMake

# One admitted selection for protocol, native inventory and metadata consumers.
# Factory builds fail closed rather than silently use an older committed header.
function(gw_admit_item_build_base target)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(GW_ITEM_RENDER_PROFILE_HEADER "" CACHE FILEPATH "Explicit isolated research render header")
set(GW_ITEM_BUILD_BASE_MANIFEST "${CMAKE_CURRENT_SOURCE_DIR}/ops/data/item-build-base-20261118.json" CACHE FILEPATH "Pinned accepted item build base manifest")
set(GW_ITEM_BUILD_BASE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/base-inputs/Forever-Base-20261118" CACHE PATH "Portable accepted item source-input bundle")
set(_args --output-directory "${CMAKE_CURRENT_BINARY_DIR}" --canonical-output "${CMAKE_CURRENT_SOURCE_DIR}/build")
if(GW_ITEM_RENDER_PROFILE_HEADER)
get_filename_component(_header "${GW_ITEM_RENDER_PROFILE_HEADER}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
list(APPEND _args --header "${_header}")
set(_inputs "${_header}")
else()
list(APPEND _args --base-manifest "${GW_ITEM_BUILD_BASE_MANIFEST}" --base-root "${GW_ITEM_BUILD_BASE_ROOT}")
set(_inputs "${GW_ITEM_BUILD_BASE_MANIFEST}")
endif()
execute_process(COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/ops/isolated_item_render_profile.py" ${_args}
RESULT_VARIABLE _status OUTPUT_VARIABLE _info ERROR_VARIABLE _error)
if(NOT _status EQUAL 0)
message(FATAL_ERROR "Accepted item build input admission failed: ${_error}")
endif()
string(JSON _staged GET "${_info}" compiled_header path)
file(TO_CMAKE_PATH "${_staged}" _staged)
target_compile_definitions(${target} PUBLIC GW_ITEM_RENDER_PROFILE_HEADER="${_staged}")
if(NOT GW_ITEM_RENDER_PROFILE_HEADER)
string(JSON _include GET "${_info}" compiled_include)
file(TO_CMAKE_PATH "${_include}" _include)
target_include_directories(${target} BEFORE PUBLIC "${_include}")
foreach(_name render_header render_profile item_package metadata_header random_property_header working_registry working_codec working_delta)
string(JSON _path GET "${_info}" base_inputs inputs ${_name} path)
list(APPEND _inputs "${_path}")
endforeach()
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${_inputs}
"${CMAKE_CURRENT_SOURCE_DIR}/ops/isolated_item_render_profile.py"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ItemBuildBase.cmake")
endfunction()