Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
K1ngst0m committed Oct 14, 2023
1 parent 48e0eba commit 98643b2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
- uses: actions/checkout@v3

- name: install dependencies
run: sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev mesa-common-dev glslang-dev libshaderc1
run: sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev mesa-common-dev

- name: Run fetch_external.py
run: python3 external/fetch_external_sources.py

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
26 changes: 17 additions & 9 deletions cmake/AphExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,31 @@ set(ENABLE_OPT OFF CACHE BOOL "" FORCE)
set(ENABLE_GLSLANG_INSTALL OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(SPIRV_CHECK_CONTEXT OFF CACHE BOOL "Disable SPIR-V IR context checking." FORCE)
set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers" CACHE STRING "SPIRV-Headers path")
set(SHADERC_SKIP_INSTALL ON CACHE BOOL "" FORCE)
set(SHADERC_SKIP_TESTS ON CACHE BOOL "" FORCE)
set(SHADERC_SKIP_EXAMPLES ON CACHE BOOL "" FORCE)
set(SPIRV-Headers_SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/spirv-headers" CACHE STRING "SPIRV-Headers path")
set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE BOOL "" FORCE)
set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE)
set(SPIRV_SKIP_TESTS ON CACHE BOOL "" FORCE)
set(SPIRV_CROSS_CLI OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "" FORCE)

# shaderc
set(SHADERC_SKIP_INSTALL ON CACHE BOOL "" FORCE)
set(SHADERC_SKIP_TESTS ON CACHE BOOL "" FORCE)
set(SHADERC_SKIP_EXAMPLES ON CACHE BOOL "" FORCE)
set(SHADERC_SKIP_COPYRIGHT_CHECK ON CACHE BOOL "" FORCE)
set(SHADERC_THIRD_PARTY_ROOT_DIR "${CMAKE_SOURCE_DIR}/external" CACHE STRING "Third party path." FORCE)


add_compile_options(-w)

add_subdirectory(external/glfw)
add_subdirectory(external/reckless)
add_subdirectory(external/imgui)
add_subdirectory(external/volk)
add_subdirectory(external/SPIRV-cross)
add_subdirectory(external/glfw EXCLUDE_FROM_ALL)
add_subdirectory(external/reckless EXCLUDE_FROM_ALL)
add_subdirectory(external/imgui EXCLUDE_FROM_ALL)
add_subdirectory(external/volk EXCLUDE_FROM_ALL)
add_subdirectory(external/spirv-cross EXCLUDE_FROM_ALL)
add_subdirectory(external/shaderc EXCLUDE_FROM_ALL)
add_subdirectory(external/mmgr EXCLUDE_FROM_ALL)

find_library(vulkan_lib NAMES vulkan HINTS "$ENV{VULKAN_SDK}/lib" "${CMAKE_SOURCE_DIR}/libs/vulkan" REQUIRED)
if (vulkan_lib)
Expand Down
6 changes: 4 additions & 2 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ target_include_directories(engine PUBLIC
../external/tinyimageformat
../external/tinyktx
../external/tinydds
../external/mmgr

PRIVATE
./
../external/libshaderc/include
../external/shaderc/libshaderc/include
../external/glfw/include
../external/imgui/include
../external/vulkan
../external/stb/include
../external/tinygltf/include
../external/SPIRV-Cross
../external/spirv-cross
)

target_link_libraries(engine PRIVATE
Expand All @@ -48,5 +49,6 @@ target_link_libraries(engine PRIVATE
spirv-cross-core
dl
dw
# mmgr
# spirv-cross-reflect
)
11 changes: 6 additions & 5 deletions external/fetch_external_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ def GetRevision(self):
def CheckOut(self):
fullDstPath = os.path.join(TargetDir, self.extractDir)
if not os.path.exists(fullDstPath):
os.system("git clone " + self.httpsUrl + " " + fullDstPath);
os.system("git clone " + self.httpsUrl + " " + fullDstPath + " --depth 1");

os.chdir(fullDstPath);
os.system("git fetch");
os.system("git checkout " + self.revision);

PACKAGES = [
# GitRepo("https://github.com/KhronosGroup/glslang.git", "glslang", "glslang"),
# GitRepo("https://github.com/KhronosGroup/SPIRV-Tools.git", "spirv-tools", "SPIRV-tools"),
# GitRepo("https://github.com/KhronosGroup/SPIRV-Headers.git", "spirv-headers", "SPIRV-tools/external/SPIRV-Headers"),
GitRepo("https://github.com/KhronosGroup/SPIRV-Cross.git", "spirv-cross", "SPIRV-cross"),
GitRepo("https://github.com/KhronosGroup/glslang.git", "glslang", "glslang"),
GitRepo("https://github.com/KhronosGroup/SPIRV-Tools.git", "spirv-tools", "spirv-tools"),
GitRepo("https://github.com/KhronosGroup/SPIRV-Headers.git", "spirv-headers", "spirv-headers"),
GitRepo("https://github.com/KhronosGroup/SPIRV-Cross.git", "spirv-cross", "spirv-cross"),
GitRepo("https://github.com/google/shaderc", "shaderc", "shaderc"),
]

def GetOpt():
Expand Down

0 comments on commit 98643b2

Please sign in to comment.