Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand All @@ -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 }}
Expand Down Expand Up @@ -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: >
Expand All @@ -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 }}
Expand Down
39 changes: 24 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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)
Expand Down
Loading