Skip to content

Commit c181570

Browse files
authored
Use global CMake output directories instead of the target's (#124)
1 parent 74c8c0e commit c181570

File tree

4 files changed

+376
-15
lines changed

4 files changed

+376
-15
lines changed

.github/workflows/cpp-build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build Workflow
2+
3+
on:
4+
push:
5+
branches: '**'
6+
paths:
7+
- '**.hpp'
8+
- '**.cpp'
9+
- '**/CMakeLists.txt'
10+
11+
- .github/workflows/cpp-build.yml
12+
- cmake/**
13+
14+
pull_request:
15+
paths:
16+
- '**.hpp'
17+
- '**.cpp'
18+
- '**/CMakeLists.txt'
19+
20+
- .github/workflows/cpp-build.yml
21+
- cmake/**
22+
23+
jobs:
24+
build:
25+
name: Build (${{ matrix.config }})
26+
runs-on: windows-latest
27+
28+
strategy:
29+
matrix:
30+
config: [Debug, Release]
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v6
35+
36+
- name: Set commit SHA environment variable
37+
run: |
38+
$sha = (git rev-parse --short ${env:GITHUB_SHA})
39+
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED4EXT_BUILD_COMMIT_SHA=${sha}"
40+
41+
- name: Set build configuration environment variable
42+
run: |
43+
$config = "${{ matrix.config }}".ToLower()
44+
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED4EXT_BUILD_CONFIG=${config}"
45+
46+
- name: Create build directory
47+
run: mkdir build
48+
49+
- name: Configure (CMake)
50+
working-directory: build
51+
run: |
52+
cmake `
53+
-DRED4EXT_GIT_METADATA=ON `
54+
-DRED4EXT_EXTRA_WARNINGS=ON `
55+
-DRED4EXT_TREAT_WARNINGS_AS_ERRORS=ON `
56+
"${{ github.workspace }}"
57+
58+
- name: Build
59+
working-directory: build
60+
run: |
61+
cmake `
62+
--build . `
63+
--config ${{ matrix.config }}
64+
65+
- name: Install
66+
working-directory: build
67+
run: |
68+
cmake `
69+
--install . `
70+
--prefix "${{ github.workspace }}/build/install" `
71+
--config ${{ matrix.config }}
72+
73+
- name: Upload artifacts
74+
uses: actions/upload-artifact@v6
75+
with:
76+
name: red4ext-${{ env.RED4EXT_BUILD_CONFIG }}-${{ env.RED4EXT_BUILD_COMMIT_SHA }}
77+
path: build/install

.github/workflows/cpp-format.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Format Workflow (C++)
2+
3+
on:
4+
push:
5+
branches: '**'
6+
paths:
7+
- '**.hpp'
8+
- '**.cpp'
9+
- .clang-format
10+
11+
- .github/workflows/cpp-format.yml
12+
13+
pull_request:
14+
paths:
15+
- '**.hpp'
16+
- '**.cpp'
17+
- .clang-format
18+
19+
- .github/workflows/cpp-format.yml
20+
21+
env:
22+
LLVM_VERSION: 21
23+
24+
jobs:
25+
format:
26+
name: Check the formatting
27+
runs-on: windows-latest
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Pin to a specific version
36+
run: |
37+
$latestChocoVersion = (Resolve-ChocoPackageVersion -TargetVersion ${env:LLVM_VERSION} -PackageName 'llvm')
38+
Install-ChocoPackage -PackageName llvm -ArgumentList '--allow-downgrade', '--version', ${latestChocoVersion}
39+
40+
- name: Determine BASE commit (push)
41+
if: github.event_name == 'push'
42+
env:
43+
GIT_COMMIT_SHA: ${{ github.event.before }}
44+
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
45+
run: |
46+
$commitSha = ${env:GIT_COMMIT_SHA}
47+
if (${commitSha} -match "^0+$") {
48+
Write-Host "'before' is all zeros. This is likely a new branch. Finding a common ancestor with the default branch."
49+
50+
$defaultBranch = ${env:GIT_DEFAULT_BRANCH}
51+
$commitSha = (git merge-base --fork-point "remotes/origin/${defaultBranch}")
52+
53+
if ([string]::IsNullOrEmpty(${commitSha})) {
54+
Write-Host "No common ancestor found, using the first commit in the repository."
55+
$commitSha = (git rev-list --max-parents=0 --reverse HEAD | Select-Object -First 1)
56+
}
57+
}
58+
59+
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED4EXT_COMMIT_BEFORE=${commitSha}"
60+
exit 0
61+
62+
- name: Determine BASE commit (pull request)
63+
if: github.event_name == 'pull_request'
64+
env:
65+
GIT_COMMIT_SHA: ${{ github.event.pull_request.base.sha }}
66+
run: |
67+
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED4EXT_COMMIT_BEFORE=${env:GIT_COMMIT_SHA}"
68+
69+
- name: Determine HEAD commit
70+
env:
71+
GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
72+
run: |
73+
Add-Content -LiteralPath ${env:GITHUB_ENV} -Encoding UTF8 -Value "RED4EXT_COMMIT_AFTER=${env:GIT_COMMIT_SHA}"
74+
75+
- name: Run clang-format
76+
run: |
77+
git `
78+
-c core.autocrlf=false `
79+
-c core.eol=lf `
80+
-c color.ui=always `
81+
clang-format `
82+
--style file `
83+
--diff ${env:RED4EXT_COMMIT_BEFORE} ${env:RED4EXT_COMMIT_AFTER}

THIRD_PARTY_LICENSES.txt

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# Third Party licenses
2+
3+
RED4ext makes use of serval libraries in order to compile and run. The libraries used and their respective licenses can be found below.
4+
5+
## RED4ext.SDK
6+
7+
MIT License
8+
9+
Copyright (c) 2020 - present Octavian Dima
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
SOFTWARE.
28+
29+
## Premake
30+
31+
Copyright (c) 2003-2019 Jason Perkins and individual contributors.
32+
All rights reserved.
33+
34+
Redistribution and use in source and binary forms, with or without modification,
35+
are permitted provided that the following conditions are met:
36+
37+
1. Redistributions of source code must retain the above copyright notice,
38+
this list of conditions and the following disclaimer.
39+
40+
2. Redistributions in binary form must reproduce the above copyright notice,
41+
this list of conditions and the following disclaimer in the documentation
42+
and/or other materials provided with the distribution.
43+
44+
3. Neither the name of Premake nor the names of its contributors may be
45+
used to endorse or promote products derived from this software without
46+
specific prior written permission.
47+
48+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
49+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
50+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
52+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58+
59+
## spdlog
60+
61+
The MIT License (MIT)
62+
63+
Copyright (c) 2016 Gabi Melman.
64+
65+
Permission is hereby granted, free of charge, to any person obtaining a copy
66+
of this software and associated documentation files (the "Software"), to deal
67+
in the Software without restriction, including without limitation the rights
68+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69+
copies of the Software, and to permit persons to whom the Software is
70+
furnished to do so, subject to the following conditions:
71+
72+
The above copyright notice and this permission notice shall be included in
73+
all copies or substantial portions of the Software.
74+
75+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
81+
THE SOFTWARE.
82+
83+
-- NOTE: Third party dependency used by this software --
84+
This software depends on the fmt lib (MIT License),
85+
and users must comply to its license: https://github.com/fmtlib/fmt/blob/master/LICENSE.rst
86+
87+
## {fmt}
88+
89+
Copyright (c) 2012 - present, Victor Zverovich
90+
91+
Permission is hereby granted, free of charge, to any person obtaining
92+
a copy of this software and associated documentation files (the
93+
"Software"), to deal in the Software without restriction, including
94+
without limitation the rights to use, copy, modify, merge, publish,
95+
distribute, sublicense, and/or sell copies of the Software, and to
96+
permit persons to whom the Software is furnished to do so, subject to
97+
the following conditions:
98+
99+
The above copyright notice and this permission notice shall be
100+
included in all copies or substantial portions of the Software.
101+
102+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
103+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
105+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
106+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
107+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
108+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
109+
110+
--- Optional exception to the license ---
111+
112+
As an exception, if, as a result of your compiling your source code, portions
113+
of this Software are embedded into a machine-executable object form of such
114+
source code, you may redistribute such embedded portions in such object form
115+
without including the above copyright and permission notices.
116+
117+
## Microsoft Detours
118+
119+
### Copyright (c) Microsoft Corporation
120+
121+
All rights reserved.
122+
123+
### MIT License
124+
125+
Permission is hereby granted, free of charge, to any person obtaining a copy of
126+
this software and associated documentation files (the "Software"), to deal in
127+
the Software without restriction, including without limitation the rights to
128+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
129+
of the Software, and to permit persons to whom the Software is furnished to do
130+
so, subject to the following conditions:
131+
132+
The above copyright notice and this permission notice shall be included in all
133+
copies or substantial portions of the Software.
134+
135+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
136+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
137+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
138+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
139+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
140+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
141+
SOFTWARE.
142+
143+
## Ordered Map
144+
145+
MIT License
146+
147+
Copyright (c) 2017 Thibaut Goetghebuer-Planchon <tessil@gmx.com>
148+
149+
Permission is hereby granted, free of charge, to any person obtaining a copy
150+
of this software and associated documentation files (the "Software"), to deal
151+
in the Software without restriction, including without limitation the rights
152+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
153+
copies of the Software, and to permit persons to whom the Software is
154+
furnished to do so, subject to the following conditions:
155+
156+
The above copyright notice and this permission notice shall be included in all
157+
copies or substantial portions of the Software.
158+
159+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
160+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
162+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
163+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
164+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
165+
SOFTWARE.
166+
167+
## toml11
168+
169+
The MIT License (MIT)
170+
171+
Copyright (c) 2017 Toru Niina
172+
173+
Permission is hereby granted, free of charge, to any person obtaining a copy
174+
of this software and associated documentation files (the "Software"), to deal
175+
in the Software without restriction, including without limitation the rights
176+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
177+
copies of the Software, and to permit persons to whom the Software is
178+
furnished to do so, subject to the following conditions:
179+
180+
The above copyright notice and this permission notice shall be included in
181+
all copies or substantial portions of the Software.
182+
183+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
184+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
185+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
186+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
187+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
188+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
189+
THE SOFTWARE.
190+
191+
## Windows Implementation Libraries (WIL)
192+
193+
MIT License
194+
195+
Copyright (c) Microsoft Corporation. All rights reserved.
196+
197+
Permission is hereby granted, free of charge, to any person obtaining a copy
198+
of this software and associated documentation files (the "Software"), to deal
199+
in the Software without restriction, including without limitation the rights
200+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
201+
copies of the Software, and to permit persons to whom the Software is
202+
furnished to do so, subject to the following conditions:
203+
204+
The above copyright notice and this permission notice shall be included in all
205+
copies or substantial portions of the Software.
206+
207+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
208+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
209+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
210+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
211+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
212+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
213+
SOFTWARE

0 commit comments

Comments
 (0)