Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 44s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 29s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 46s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 30s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m21s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m3s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m25s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m8s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m9s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m34s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m13s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 37s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 28s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 57s
Bigfoot / Sonarqube (push) Successful in 6m0s
sonarqube ERROR
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 49s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 30s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 36s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m23s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 44s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 59s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 51s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m5s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 56s
Bigfoot / Clang Format Checks (push) Successful in 13s
Bigfoot / Sonarqube (pull_request) Failing after 5m14s
Implementing an asset management system BigFile is a sqlite database, for toolmode Sasquatch is a custom binary file, for gamemode Assets are built from flatbuffers References allow to get an Asset, from an UUID, from anywhere in the code HardReference refcount the asset and allow automatic removal Reviewed-on: #1 Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com>
140 lines
5.7 KiB
CMake
140 lines
5.7 KiB
CMake
function(bigfoot_create_logger)
|
|
set(LOGGER_FILENAME ${PROJECT_NAME}Logger)
|
|
string(TOUPPER ${PROJECT_NAME}_Logger LOGGER_NAME)
|
|
string(TOUPPER ${LOGGER_FILENAME} LOGGER_FILENAME_UPPER)
|
|
configure_file( ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Utils/Include/Utils/Log/TargetLogger_generated.hpp.in
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Include/${PROJECT_NAME}/${LOGGER_FILENAME}_generated.hpp
|
|
@ONLY)
|
|
endfunction()
|
|
|
|
function(bigfoot_create_bigfile ParentFolder)
|
|
set(OUTPUT_PATH_BIGFILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.db")
|
|
get_filename_component(OUTPUT_PATH_BIGFILE_ABSOLUTE ${OUTPUT_PATH_BIGFILE} ABSOLUTE)
|
|
get_filename_component(OUTPUT_PATH_BIGFILE_DIRECTORY ${OUTPUT_PATH_BIGFILE_ABSOLUTE} DIRECTORY)
|
|
|
|
add_custom_command(
|
|
OUTPUT ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp ${OUTPUT_PATH_BIGFILE_ABSOLUTE}
|
|
DEPENDS ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_PATH_BIGFILE_DIRECTORY}
|
|
COMMAND ${SQLITE3_EXECUTABLE} ${OUTPUT_PATH_BIGFILE_ABSOLUTE} < ${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/BigFile/BigFileSchema.sql
|
|
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp
|
|
COMMENT "Creating Bigfile ${OUTPUT_PATH_BIGFILE_ABSOLUTE}"
|
|
)
|
|
|
|
add_custom_target(${PROJECT_NAME}BigFile ALL
|
|
DEPENDS ${OUTPUT_PATH_BIGFILE_ABSOLUTE}.bftimestamp
|
|
)
|
|
|
|
set_target_properties(${PROJECT_NAME}BigFile PROPERTIES FOLDER UtilityTargets/${ParentFolder})
|
|
|
|
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}BigFile)
|
|
|
|
string(TOUPPER ${PROJECT_NAME} BIGFILE_NAME)
|
|
set(BIGFILE_LOCATION "./${PROJECT_NAME}.db")
|
|
configure_file(
|
|
${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/Include/Engine/BigFile/BigFileInfo_generated.hpp.in
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Include/${PROJECT_NAME}/BigFileInfo_generated.hpp
|
|
@ONLY
|
|
)
|
|
endfunction()
|
|
|
|
function(bigfoot_create_sasquatch_info)
|
|
string(TOUPPER ${PROJECT_NAME} SASQUATCH_NAME)
|
|
set(SASQUATCH_LOCATION "./${PROJECT_NAME}.sasquatch")
|
|
configure_file(
|
|
${CMAKE_SOURCE_DIR}/Bigfoot/Sources/Engine/Include/Engine/Sasquatch/SasquatchInfo_generated.hpp.in
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Include/${PROJECT_NAME}/SasquatchInfo_generated.hpp
|
|
@ONLY
|
|
)
|
|
endfunction()
|
|
|
|
function(_bigfoot_collect_includes_recursive Target UseAllLinks)
|
|
get_property(_Visited GLOBAL PROPERTY _BIGFOOT_VISITED_TARGETS)
|
|
if("${Target}" IN_LIST _Visited)
|
|
return()
|
|
endif()
|
|
set_property(GLOBAL APPEND PROPERTY _BIGFOOT_VISITED_TARGETS "${Target}")
|
|
|
|
get_target_property(_IncDirs "${Target}" INTERFACE_INCLUDE_DIRECTORIES)
|
|
if(_IncDirs)
|
|
foreach(_Dir IN LISTS _IncDirs)
|
|
if(_Dir MATCHES "^\\$<BUILD_INTERFACE:(.+)>$")
|
|
set_property(GLOBAL APPEND PROPERTY _BIGFOOT_INCLUDE_DIRS "${CMAKE_MATCH_1}")
|
|
elseif(NOT _Dir MATCHES "^\\$<")
|
|
set_property(GLOBAL APPEND PROPERTY _BIGFOOT_INCLUDE_DIRS "${_Dir}")
|
|
endif()
|
|
endforeach()
|
|
endif()
|
|
|
|
if(UseAllLinks)
|
|
get_target_property(_Libs "${Target}" LINK_LIBRARIES)
|
|
else()
|
|
get_target_property(_Libs "${Target}" INTERFACE_LINK_LIBRARIES)
|
|
endif()
|
|
if(NOT _Libs)
|
|
return()
|
|
endif()
|
|
foreach(_Lib IN LISTS _Libs)
|
|
if(_Lib MATCHES "^\\$<LINK_LIBRARY:[^,]+,(.+)>$")
|
|
foreach(_Inner IN LISTS CMAKE_MATCH_1)
|
|
if(TARGET "${_Inner}")
|
|
_bigfoot_collect_includes_recursive("${_Inner}" FALSE)
|
|
endif()
|
|
endforeach()
|
|
elseif(NOT _Lib MATCHES "^\\$<" AND TARGET "${_Lib}")
|
|
_bigfoot_collect_includes_recursive("${_Lib}" FALSE)
|
|
endif()
|
|
endforeach()
|
|
endfunction()
|
|
|
|
function(bigfoot_compile_flatbuffers)
|
|
set_property(GLOBAL PROPERTY _BIGFOOT_VISITED_TARGETS "")
|
|
set_property(GLOBAL PROPERTY _BIGFOOT_INCLUDE_DIRS "")
|
|
_bigfoot_collect_includes_recursive(${PROJECT_NAME} TRUE)
|
|
|
|
get_property(_CollectedDirs GLOBAL PROPERTY _BIGFOOT_INCLUDE_DIRS)
|
|
set(IncludeFolders "${CMAKE_CURRENT_SOURCE_DIR}/Include" ${_CollectedDirs})
|
|
list(REMOVE_DUPLICATES IncludeFolders)
|
|
|
|
set(IncludeFlags "")
|
|
foreach(folder IN LISTS IncludeFolders)
|
|
list(APPEND IncludeFlags -I "${folder}")
|
|
endforeach()
|
|
|
|
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/Include/*.fbs")
|
|
foreach(SOURCE_FILE IN LISTS SOURCES)
|
|
get_filename_component(SOURCE_DIRECTORY ${SOURCE_FILE} DIRECTORY)
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SOURCE_FILE})
|
|
|
|
execute_process(
|
|
COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE}
|
|
--cpp
|
|
${IncludeFlags}
|
|
--keep-prefix
|
|
--filename-ext "hpp"
|
|
--cpp-std c++17
|
|
--reflect-names
|
|
--reflect-types
|
|
--gen-name-strings
|
|
--gen-object-api
|
|
--cpp-str-flex-ctor
|
|
--no-cpp-direct-copy
|
|
--force-empty
|
|
--cpp-ptr-type "eastl::unique_ptr"
|
|
--cpp-str-type "eastl::string"
|
|
--cpp-vector-type "eastl::vector"
|
|
--cpp-include "EASTL/unique_ptr.h"
|
|
--cpp-include "EASTL/string.h"
|
|
--cpp-include "EASTL/vector.h"
|
|
-o "${SOURCE_DIRECTORY}"
|
|
--schema "${SOURCE_FILE}"
|
|
)
|
|
endforeach()
|
|
endfunction()
|
|
|
|
macro(bigfoot_remove_default_exception_flags)
|
|
if(MSVC)
|
|
string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
string(REPLACE "/EHs" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
endif()
|
|
endmacro() |