Bin2CPP
Some checks failed
Bigfoot / Clang Format Checks (push) Failing after 9s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Failing after 16m30s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Failing after 3h0m50s
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Failing after 3h1m54s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Failing after 14m59s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Failing after 8m41s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Failing after 7m26s

This commit is contained in:
2026-03-29 03:03:13 +02:00
parent ab96945192
commit 9c59bd6ab8
29 changed files with 782 additions and 179 deletions

View File

@@ -38,15 +38,22 @@ endfunction()
function(bigfoot_compile_flatbuffers BigfootDependencies)
set(IncludeFolders "")
get_target_property(CurrentTargetDependencyInclude ${PROJECT_NAME} INCLUDE_DIRECTORIES)
if(CurrentTargetDependencyInclude)
list(APPEND IncludeFolders ${CurrentTargetDependencyInclude})
endif()
list(APPEND IncludeFolders ${CMAKE_CURRENT_SOURCE_DIR}/Include)
foreach(Dependency IN LISTS BigfootDependencies)
get_target_property(DependencyInclude ${Dependency} INCLUDE_DIRECTORIES)
if(DependencyInclude)
list(APPEND IncludeFolders ${DependencyInclude})
if(TARGET ${Dependency})
get_target_property(DependencyIncludeDirs ${Dependency} INTERFACE_INCLUDE_DIRECTORIES)
if(DependencyIncludeDirs)
foreach(Dir IN LISTS DependencyIncludeDirs)
# Strip $<BUILD_INTERFACE:...> generator expression
if(Dir MATCHES "^\\$<BUILD_INTERFACE:(.+)>$")
list(APPEND IncludeFolders "${CMAKE_MATCH_1}")
elseif(NOT Dir MATCHES "^\\$<")
# Pass through plain paths, skip other generator expressions
list(APPEND IncludeFolders "${Dir}")
endif()
endforeach()
endif()
endif()
endforeach()
@@ -58,7 +65,7 @@ function(bigfoot_compile_flatbuffers BigfootDependencies)
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/Include/*.fbs")
foreach(SOURCE_FILE IN LISTS SOURCES)
get_filename_component(SOURCE_DIRECTORY ${SOURCE_FILE} DIRECTORY)
get_filename_component(SOURCE_NAME_WE ${SOURCE_FILE} NAME_WE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SOURCE_FILE})
execute_process(
@@ -80,66 +87,16 @@ function(bigfoot_compile_flatbuffers BigfootDependencies)
--cpp-include "EASTL/unique_ptr.h"
--cpp-include "EASTL/string.h"
-o "${SOURCE_DIRECTORY}"
"${SOURCE_FILE}"
"${SOURCE_FILE}"
)
execute_process(
COMMAND ${BIN2CPP_EXECUTABLE}
--input "${SOURCE_FILE}"
--output "${SOURCE_DIRECTORY}/${SOURCE_NAME_WE}.fbs_generated.hpp"
--arrayType eastl::array
--arrayInclude <EASTL/array.h>
--namespace Bigfoot
)
endforeach()
endfunction()
function(bigfoot_setup_dependencies ParentFolder)
set(CONAN_DEPLOYER_DIR "${CMAKE_SOURCE_DIR}/build/full_deploy/host")
if(EXISTS ${CONAN_DEPLOYER_DIR})
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
file(GLOB_RECURSE SHARED_BINARIES ${CONAN_DEPLOYER_DIR}/*mimalloc*.dll)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(GLOB_RECURSE SHARED_BINARIES ${CONAN_DEPLOYER_DIR}/*mimalloc*.so*)
endif()
if(${IS_MULTI_CONFIG})
foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
foreach(file ${SHARED_BINARIES})
if(file MATCHES "/${CONFIG}/")
list(APPEND SHARED_BINARIES_${CONFIG} ${file})
endif()
endforeach()
endforeach()
add_custom_target(${PROJECT_NAME}CopySharedBinaries
ALL DEPENDS SHARED_BINARIES
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_if_different,true> ${SHARED_BINARIES_Debug} $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Release>,copy_if_different,true> ${SHARED_BINARIES_Release} $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:RelWithDebInfo>,copy_if_different,true> ${SHARED_BINARIES_RelWithDebInfo} $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMENT "Copy shared binaries for ${PROJECT_NAME}"
)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}CopySharedBinaries)
set_target_properties(${PROJECT_NAME}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder})
else()
foreach(file ${SHARED_BINARIES})
if(file MATCHES "/${CMAKE_BUILD_TYPE}/")
list(APPEND SHARED_BINARIES_${CMAKE_BUILD_TYPE} ${file})
endif()
endforeach()
add_custom_target(${PROJECT_NAME}CopySharedBinaries ALL
DEPENDS ${SHARED_BINARIES_${CMAKE_BUILD_TYPE}}
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SHARED_BINARIES_${CMAKE_BUILD_TYPE}} $<TARGET_FILE_DIR:${PROJECT_NAME}>
COMMENT "Copy shared binaries for ${PROJECT_NAME}"
)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}CopySharedBinaries)
set_target_properties(${PROJECT_NAME}CopySharedBinaries PROPERTIES FOLDER UtilityTargets/${ParentFolder})
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_custom_target(${PROJECT_NAME}PatchMinject ALL
COMMAND ${MINJECT_EXECUTABLE} -i -f $<TARGET_FILE:${PROJECT_NAME}>
COMMENT "Patching ${PROJECT_NAME} to ensure mimalloc dynamic override"
)
add_dependencies(${PROJECT_NAME}PatchMinject ${PROJECT_NAME})
set_target_properties(${PROJECT_NAME}PatchMinject PROPERTIES FOLDER "UtilityTargets/${ParentFolder}")
endif()
endfunction()