Skip to content

Commit

Permalink
Action fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maluoi committed Mar 18, 2024
1 parent 58720b6 commit 1e03d71
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 36 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
cmake --build --preset skshaderc_Win32_x64_Release
mkdir bin/distribute/win32_x64
copy bin/intermediate/Win32_x64_Release/Release/skshaderc_exe.exe bin/distribute/win32_x64/skshaderc.exe
copy bin/intermediate/Win32_x64/Release/skshaderc_exe.exe bin/distribute/win32_x64/skshaderc.exe
- name: Build Native Win32 Arm64
run: |
cmake --preset skshaderc_Win32_Arm64_Release
cmake --build --preset skshaderc_Win32_Arm64_Release
mkdir bin/distribute/win32_arm64
copy bin/intermediate/Win32_Arm64_Release/Release/skshaderc_exe.exe bin/distribute/win32_arm64/skshaderc.exe
copy bin/intermediate/Win32_Arm64/Release/skshaderc_exe.exe bin/distribute/win32_arm64/skshaderc.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -109,13 +109,13 @@ jobs:
ref: ${{ inputs.branch }}
- uses: lukka/get-cmake@v3.26.3

- name: Build Native Linux x64
- name: Build Native Mac x64
run: |
cmake --preset skshaderc_Linux_x64_Release
cmake --build --preset skshaderc_Linux_x64_Release
cmake --preset skshaderc_Mac_x64_Release
cmake --build --preset skshaderc_Mac_x64_Release
mkdir -p bin/distribute/mac_arm64
cp bin/intermediate/Linux_Arm64_Release/Release/skshaderc_exe bin/distribute/mac_arm64/skshaderc
cp bin/intermediate/Mac_Arm64_Release/Release/skshaderc_exe bin/distribute/mac_arm64/skshaderc
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ project(sk_gpu VERSION 0.1
DESCRIPTION "Single header cross-platform graphics api."
LANGUAGES CXX)

# Make switches for each of the subdirectories
option(SK_BUILD_SHADERC "Build the shader compiler" ON)
option(SK_BUILD_EDITOR "Build the shader editor" ON)
option(SK_BUILD_EXAMPLES "Build the examples" ON)

add_subdirectory(src)
add_subdirectory(skshaderc)
add_subdirectory(skshader_editor)
add_subdirectory(examples/sk_gpu_flat)
if (SK_BUILD_SHADERC)
add_subdirectory(skshaderc)
endif()
if (SK_BUILD_EDITOR)
add_subdirectory(skshader_editor)
endif()
if (SK_BUILD_EXAMPLES)
add_subdirectory(examples/sk_gpu_flat)
endif()
93 changes: 66 additions & 27 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
Expand All @@ -16,8 +16,10 @@
"CMAKE_EXE_LINKER_FLAGS": "/LTCG /INCREMENTAL:NO",
"CMAKE_SHARED_LINKER_FLAGS": "/LTCG /INCREMENTAL:NO",
"CMAKE_STATIC_LINKER_FLAGS": "/LTCG",
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "TRUE"
}
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "TRUE",
"SK_BUILD_EDITOR":false,
"SK_BUILD_EXAMPLES":false
}
},
{
"name": "skshaderc_Win32_x64_Release",
Expand All @@ -40,13 +42,15 @@
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Linux",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_LINKER": "lld",
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=lld",
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=lld",
"CMAKE_MODULE_LINKER_FLAGS": "-fuse-ld=lld"
"CMAKE_SYSTEM_NAME": "Linux",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_LINKER": "lld",
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=lld",
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=lld",
"CMAKE_MODULE_LINKER_FLAGS": "-fuse-ld=lld",
"SK_BUILD_EDITOR":false,
"SK_BUILD_EXAMPLES":false
}
},
{
Expand All @@ -56,7 +60,7 @@
"inherits": "Linux",
"binaryDir": "${sourceDir}/bin/intermediate/Linux_x64_Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release"
}
},
{
Expand All @@ -66,26 +70,61 @@
"inherits": "Linux",
"binaryDir": "${sourceDir}/bin/intermediate/Linux_ARM64_Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_AR": "/usr/bin/aarch64-linux-gnu-ar",
"CMAKE_LINKER": "/usr/bin/aarch64-linux-gnu-ld",
"CMAKE_OBJCOPY": "/usr/bin/aarch64-linux-gnu-objcopy",
"CMAKE_RANLIB": "/usr/bin/aarch64-linux-gnu-ranlib",
"CMAKE_SIZE": "/usr/bin/aarch64-linux-gnu-size",
"CMAKE_STRIP": "/usr/bin/aarch64-linux-gnu-strip",
"CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
"CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
"CMAKE_SYSTEM_PROCESSOR": "arm64",
"CMAKE_EXE_LINKER_FLAGS": null,
"CMAKE_SHARED_LINKER_FLAGS": null,
"CMAKE_MODULE_LINKER_FLAGS": null
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_AR": "/usr/bin/aarch64-linux-gnu-ar",
"CMAKE_LINKER": "/usr/bin/aarch64-linux-gnu-ld",
"CMAKE_OBJCOPY": "/usr/bin/aarch64-linux-gnu-objcopy",
"CMAKE_RANLIB": "/usr/bin/aarch64-linux-gnu-ranlib",
"CMAKE_SIZE": "/usr/bin/aarch64-linux-gnu-size",
"CMAKE_STRIP": "/usr/bin/aarch64-linux-gnu-strip",
"CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
"CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
"CMAKE_SYSTEM_PROCESSOR": "arm64",
"CMAKE_EXE_LINKER_FLAGS": null,
"CMAKE_SHARED_LINKER_FLAGS": null,
"CMAKE_MODULE_LINKER_FLAGS": null
}
},
{
"name": "Mac",
"description": "Build for Mac",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Darwin",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER":"clang++",
"SK_BUILD_EDITOR":false,
"SK_BUILD_EXAMPLES":false
}
},
{
"name": "skshaderc_Mac_x64_Release",
"description": "Release build for Mac x64",
"hidden": false,
"inherits": "Mac",
"binaryDir": "${sourceDir}/bin/intermediate/Mac_x64_Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "skshaderc_Mac_Arm64_Release",
"description": "Release build for Mac Arm64",
"hidden": false,
"inherits": "Mac",
"binaryDir": "${sourceDir}/bin/intermediate/Mac_ARM64_Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"buildPresets": [
{ "name":"skshaderc_Win32_x64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"Release", "configurePreset":"skshaderc_Win32_x64_Release", "jobs":24},
{ "name":"skshaderc_Win32_Arm64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"Release", "configurePreset":"skshaderc_Win32_Arm64_Release", "jobs":24},
{ "name":"skshaderc_Linux_x64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"MinSizeRelease", "configurePreset":"skshaderc_Linux_x64_Release", "jobs":24},
{ "name":"skshaderc_Linux_Arm64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"MinSizeRelease", "configurePreset":"skshaderc_Linux_Arm64_Release", "jobs":24}
{ "name":"skshaderc_Linux_Arm64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"MinSizeRelease", "configurePreset":"skshaderc_Linux_Arm64_Release", "jobs":24},
{ "name":"skshaderc_Mac_x64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"MinSizeRelease", "configurePreset":"skshaderc_Mac_x64_Release", "jobs":24},
{ "name":"skshaderc_Mac_Arm64_Release", "targets": ["sk_gpu_header", "skshaderc"], "configuration":"MinSizeRelease", "configurePreset":"skshaderc_Mac_Arm64_Release", "jobs":24}
]
}

0 comments on commit 1e03d71

Please sign in to comment.