diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 0cb2a3292..10aa31471 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -63,6 +63,18 @@ jobs: # Libraries + - name: Sparse fetch neoAssets + uses: actions/checkout@v6 + with: + repository: NeotokyoRebuild/neoAssets + path: neoAssets + sparse-checkout: + neo/detail.vbsp + neo/lights.rad + neo/resource/ + neo/shaders/fxc/ + neo/rebuild.fgd + - name: CMake configure libraries build working-directory: ${{ env.source_dir }} run: > @@ -75,6 +87,7 @@ jobs: -DNEO_USE_SEPARATE_BUILD_INFO=ON -DNEO_INSTALL_LIBRARIES=ON -DNEO_INSTALL_RESOURCES=OFF + -DNEO_EXTRA_ASSETS_ALT_PATH=${{ github.workspace }}/neoAssets - name: CMake libraries build working-directory: ${{ env.source_dir }} @@ -205,6 +218,18 @@ jobs: # Libraries + - name: Sparse fetch neoAssets + uses: actions/checkout@v6 + with: + repository: NeotokyoRebuild/neoAssets + path: neoAssets + sparse-checkout: + neo/detail.vbsp + neo/lights.rad + neo/resource/ + neo/shaders/fxc/ + neo/rebuild.fgd + - name: CMake configure libraries build working-directory: ${{ env.source_dir }} run: > @@ -217,6 +242,7 @@ jobs: -DNEO_USE_SEPARATE_BUILD_INFO=ON -DNEO_INSTALL_LIBRARIES=ON -DNEO_INSTALL_RESOURCES=OFF + -DNEO_EXTRA_ASSETS_ALT_PATH=${{ github.workspace }}/neoAssets - name: CMake libraries build working-directory: ${{ env.source_dir }} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dbd91d961..e6c59cf1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,6 +39,7 @@ option(NEO_BUILD_MATHLIB "Build mathlib library" ON) option(NEO_BUILD_VGUI_CONTROLS "Build vgui_controls library" ON) option(NEO_COPY_LIBRARIES "Copy libraries to bin directory by default" ON) option(NEO_EXTRA_ASSETS "Copy extra assets into game/neo" ON) +option(NEO_EXTRA_ASSETS_ALT_PATH "Alternate location to fetch the extra assets" "") if (OS_LINUX) set(NEO_OUTPUT_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/../game/neo/bin/linux64" CACHE PATH "Directory for output libraries (linux64)") else () @@ -67,6 +68,7 @@ message(STATUS "Build mathlib library: ${NEO_BUILD_MATHLIB}") message(STATUS "Build vgui_controls library: ${NEO_BUILD_VGUI_CONTROLS}") message(STATUS "Copy libraries to bin directory by default: ${NEO_COPY_LIBRARIES}") message(STATUS "Copy extra assets into game/neo: ${NEO_EXTRA_ASSETS}") +message(STATUS "Alternate location to fetch the extra assets: ${NEO_EXTRA_ASSETS_ALT_PATH}") message(STATUS "Directory for output libraries: ${NEO_OUTPUT_LIBRARY_PATH}") message(STATUS "Install game libraries: ${NEO_INSTALL_LIBRARIES}") message(STATUS "Install game resources: ${NEO_INSTALL_RESOURCES}") @@ -593,23 +595,30 @@ if(NEO_INSTALL_RESOURCES) endif() if(NEO_EXTRA_ASSETS) - include(FetchContent) # once in the project to include the module - - FetchContent_Declare( - neo_assets - GIT_REPOSITORY https://github.com/NeotokyoRebuild/neoAssets.git - GIT_TAG master # Replace with a commit hash or other tag to select a specific version of the assets, remove GIT_SHALLOW if using commit hash - GIT_SHALLOW 1 - GIT_PROGRESS TRUE - USES_TERMINAL_DOWNLOAD TRUE - ) + if(NEO_EXTRA_ASSETS_ALT_PATH) + execute_process( + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${NEO_EXTRA_ASSETS_ALT_PATH}/neo" + "${CMAKE_SOURCE_DIR}/../game/neo") + else() + include(FetchContent) # once in the project to include the module + + FetchContent_Declare( + neo_assets + GIT_REPOSITORY https://github.com/NeotokyoRebuild/neoAssets.git + GIT_TAG master # Replace with a commit hash or other tag to select a specific version of the assets, remove GIT_SHALLOW if using commit hash + GIT_SHALLOW 1 + GIT_PROGRESS TRUE + USES_TERMINAL_DOWNLOAD TRUE + ) - FetchContent_MakeAvailable(neo_assets) + FetchContent_MakeAvailable(neo_assets) - execute_process( - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${neo_assets_SOURCE_DIR}/neo" - "${CMAKE_SOURCE_DIR}/../game/neo") + execute_process( + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${neo_assets_SOURCE_DIR}/neo" + "${CMAKE_SOURCE_DIR}/../game/neo") + endif() endif() add_subdirectory(tests)