Skip to content

Commit

Permalink
build: allow multiple presets (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlayaN authored Aug 4, 2024
1 parent e5735be commit 586d5d6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 80 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,26 @@ on:
permissions:
contents: write

env:
VCPKG_COMMIT_ID: 34742e119fb2aae42f10c03a98e475eb1934f7c9

jobs:
compile:
name: build plugin and addons
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
submodules: recursive

- uses: ilammy/msvc-dev-cmd@v1.10.0

- uses: lukka/run-vcpkg@v11
- uses: lukka/run-vcpkg@v11.5
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
vcpkgJsonGlob: vcpkg.json

- name: cmake configure
run: cmake -S . --preset=ALL --check-stamp-file "build\CMakeFiles\generate.stamp"

- name: cmake build
run: cmake --build build --config Release
run: cmake --build build/ALL --config Release

- name: create a tagged release and upload the archive
uses: ncipollo/release-action@v1
Expand Down
4 changes: 2 additions & 2 deletions BuildRelease.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ if NOT "%1" == "" (

echo Running preset %preset%

cmake -S . --preset=%preset% --check-stamp-file "build\CMakeFiles\generate.stamp"
cmake -S . --preset=%preset% --check-stamp-file "build\%preset%\CMakeFiles\generate.stamp"
if %ERRORLEVEL% NEQ 0 exit 1
cmake --build build --config Release
cmake --build build/%preset% --config Release
if %ERRORLEVEL% NEQ 0 exit 1

pause
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ target_link_libraries(
pystring::pystring
unordered_dense::unordered_dense
efsw::efsw
${NVAPI_LIBRARY}
${NVAPI_LIBRARY}
)

# https://gitlab.kitware.com/cmake/cmake/-/issues/24922#note_1371990
Expand Down
71 changes: 21 additions & 50 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@
"cacheVariables": {
"SKSE_SUPPORT_XBYAK": "ON"
},
"binaryDir": "${sourceDir}/build"
"binaryDir": "${sourceDir}/build/${presetName}"
},
{
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "STRING",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"VCPKG_OVERLAY_PORTS": {
"type": "STRING",
"value": "${sourceDir}/cmake/ports/"
},
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_OVERLAY_PORTS": "${sourceDir}/cmake/ports/",
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
}
},
Expand Down Expand Up @@ -53,12 +47,11 @@
}
},
{
"name": "AE",
"name": "skyrim",
"hidden": true,
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "ON",
"ENABLE_SKYRIM_SE": "OFF",
"ENABLE_SKYRIM_VR": "OFF"
"BUILD_TESTS": "OFF"
},
"inherits": [
"common",
Expand All @@ -67,81 +60,59 @@
"msvc"
]
},
{
"name": "AE",
"cacheVariables": {
"ENABLE_SKYRIM_AE": "ON",
"ENABLE_SKYRIM_SE": "OFF",
"ENABLE_SKYRIM_VR": "OFF"
},
"inherits": "skyrim"
},
{
"name": "SE",
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "OFF",
"ENABLE_SKYRIM_SE": "ON",
"ENABLE_SKYRIM_VR": "OFF"
},
"inherits": [
"common",
"vcpkg",
"win64",
"msvc"
]
"inherits": "skyrim"
},
{
"name": "VR",
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "OFF",
"ENABLE_SKYRIM_SE": "OFF",
"ENABLE_SKYRIM_VR": "ON"
},
"inherits": [
"common",
"vcpkg",
"win64",
"msvc"
]
"inherits": "skyrim"
},
{
"name": "ALL",
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "ON",
"ENABLE_SKYRIM_SE": "ON",
"ENABLE_SKYRIM_VR": "ON"
},
"inherits": [
"common",
"vcpkg",
"win64",
"msvc"
]
"inherits": "skyrim"
},
{
"name": "PRE-AE",
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "OFF",
"ENABLE_SKYRIM_SE": "ON",
"ENABLE_SKYRIM_VR": "ON"
},
"inherits": [
"common",
"vcpkg",
"win64",
"msvc"
]
"inherits": "skyrim"
},
{
"name": "FLATRIM",
"cacheVariables": {
"BUILD_SKYRIM": true,
"ENABLE_SKYRIM_AE": "ON",
"ENABLE_SKYRIM_SE": "ON",
"ENABLE_SKYRIM_VR": "OFF",
"Build Tests": "OFF"
"ENABLE_SKYRIM_VR": "OFF"
},
"inherits": [
"common",
"vcpkg",
"win64",
"msvc"
]
"inherits": "skyrim"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you want an example CMakeUserPreset to start off with you can copy the `CMake
* Make sure `"AUTO_PLUGIN_DEPLOYMENT"` is set to `"ON"` in `CMakeUserPresets.json`
* Change the `"CommunityShadersOutputDir"` value to match your desired outputs, if you want multiple folders you can separate them by `;` is shown in the template example
#### AIO_ZIP_TO_DIST
* This option is default `"OFF"`
* This option is default `"ON"`
* Make sure `"AIO_ZIP_TO_DIST"` is set to `"ON"` in `CMakeUserPresets.json`
* This will create a `CommunityShaders_AIO.7z` archive in /dist containing all features and base mod
#### ZIP_TO_DIST
Expand Down
42 changes: 23 additions & 19 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "communityshaders",
"version-semver": "0.7.4",
"description": "",
"license": "GPL-3.0",
"features": {
"commonlibsse-ng": {
"description": "Dependencies of clib-ng",
"dependencies": ["fmt", "directxtk", "rapidcsv", "spdlog"]
}
},
"default-features": ["commonlibsse-ng"],
"dependencies": [
"bshoshany-thread-pool",
"clib-util",
"cppwinrt",
"fmt",
"directxtk",
"rapidcsv",
"spdlog",
"magic-enum",
"xbyak",
"catch2",
"magic-enum",
"nlohmann-json",
"pystring",
"directxtex",
"eastl",
"efsw",
{
"name": "imgui",
"features": ["dx11-binding", "win32-binding", "docking-experimental"],
"version>=": "1.88"
"features": ["dx11-binding", "win32-binding", "docking-experimental"]
},
"eastl",
"clib-util",
"magic-enum",
"magic-enum",
"nlohmann-json",
"pystring",
"unordered-dense",
"efsw"
"xbyak"
],
"overrides": [
{
"name": "bshoshany-thread-pool",
"version-string": "3.5.0"
"version": "3.5.0"
},
{
"name": "imgui",
"version": "1.90"
}
],
"builtin-baseline": "83972272512ce4ede5fc3b2ba98f6468b179f192"
"builtin-baseline": "1dc5ee30eb1032221d29f281f4a94b73f06b4284"
}

0 comments on commit 586d5d6

Please sign in to comment.