Skip to content

Commit db6ba54

Browse files
authored
Merge pull request #16 from aregtech/feature/15-fetch-areg-framework
15 fetching areg-sdk in cmake
2 parents d046af7 + 71966ba commit db6ba54

File tree

8 files changed

+317
-185
lines changed

8 files changed

+317
-185
lines changed

.github/workflows/cmake.yml

+161-67
Original file line numberDiff line numberDiff line change
@@ -24,101 +24,195 @@ jobs:
2424
matrix:
2525
config: # Create matrix with combinations
2626
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs
27-
- { name: linux-gnu-shared-ext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON}
27+
- { name: linux-gnu-g++-shared,
28+
os: ubuntu-latest,
29+
lib: shared,
30+
family: gnu,
31+
cxx: g++,
32+
comp: ON,
33+
before: ON
34+
}
35+
2836
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and no logs
29-
- { name: linux-gnu-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: OFF}
37+
- { name: linux-gnu-g++-static,
38+
os: ubuntu-latest,
39+
lib: static,
40+
family: gnu,
41+
cxx: g++,
42+
comp: OFF,
43+
before: OFF
44+
}
45+
3046
# compile AREG engine as a static library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs
31-
- { name: linux-gnu-static-ext-log, os: ubuntu-latest, lib: static, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON}
47+
- { name: linux-gnu-gcc-shared,
48+
os: ubuntu-latest,
49+
lib: shared,
50+
family: gnu,
51+
cxx: gcc,
52+
comp: OFF,
53+
before: ON
54+
}
55+
3256
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and logs
33-
- { name: linux-gnu-shared-noext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: ON}
34-
# compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and no logs
35-
- { name: linux-gnu-shared-noext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: OFF}
57+
- { name: linux-gnu-gcc-static,
58+
os: ubuntu-latest,
59+
lib: shared,
60+
family: gnu,
61+
cxx: gcc,
62+
comp: ON,
63+
before: OFF
64+
}
65+
66+
# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs
67+
- { name: linux-llvm-clang++-shared,
68+
os: ubuntu-latest,
69+
lib: shared,
70+
family: llvm,
71+
cxx: clang++,
72+
comp: ON,
73+
before: ON
74+
}
75+
76+
# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs
77+
- { name: linux-llvm-clang++-static,
78+
os: ubuntu-latest,
79+
lib: static,
80+
family: llvm,
81+
cxx: clang++,
82+
comp: OFF,
83+
before: OFF
84+
}
85+
3686
# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs
37-
- { name: linux-clang-shared-ext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON}
87+
- { name: linux-llvm-clang-shared,
88+
os: ubuntu-latest,
89+
lib: shared,
90+
family: llvm,
91+
cxx: clang,
92+
comp: OFF,
93+
before: ON
94+
}
95+
3896
# compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs
39-
- { name: linux-clang-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: OFF}
40-
# compile AREG engine as a static library with clang on Ubuntu Linux, enable AREG extensions and logs
41-
- { name: linux-clang-static-ext-log, os: ubuntu-latest, lib: static, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON}
42-
# compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and logs
43-
- { name: linux-clang-shared-noext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: ON}
44-
# compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and no logs
45-
- { name: linux-clang-shared-noext-nolog,os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: OFF}
97+
- { name: linux-llvm-clang-static,
98+
os: ubuntu-latest,
99+
lib: static,
100+
family: llvm,
101+
cxx: clang,
102+
comp: ON,
103+
before: OFF
104+
}
105+
106+
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
107+
- { name: win-cygwin-g++-shared,
108+
os: windows-latest,
109+
lib: shared,
110+
family: cygwin,
111+
cxx: g++,
112+
comp: ON,
113+
before: ON
114+
}
115+
116+
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
117+
- { name: win-cygwin-g++-static,
118+
os: windows-latest,
119+
lib: static,
120+
family: cygwin,
121+
cxx: g++,
122+
comp: OFF,
123+
before: OFF
124+
}
125+
126+
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
127+
- { name: win-cygwin-gcc-shared,
128+
os: windows-latest,
129+
lib: shared,
130+
family: cygwin,
131+
cxx: gcc,
132+
comp: OFF,
133+
before: ON
134+
}
135+
46136
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
47-
- { name: win-cygwin-shared-ext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON}
48-
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and no logs
49-
- { name: win-cygwin-shared-ext-nolog, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: OFF}
50-
# compile AREG engine as a static with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs
51-
- { name: win-cygwin-static-ext-log, os: windows-latest, lib: static, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON}
52-
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and logs
53-
- { name: win-cygwin-shared-noext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: ON}
54-
# compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and no logs
55-
- { name: win-cygwin-shared-noext-nolog,os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: OFF}
137+
- { name: win-cygwin-gcc-static,
138+
os: windows-latest,
139+
lib: static,
140+
family: cygwin,
141+
cxx: gcc,
142+
comp: ON,
143+
before: OFF
144+
}
145+
56146
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs
57-
- { name: win-msvc-shared-ext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON}
58-
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs
59-
- { name: win-msvc-shared-ext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: OFF}
60-
# compile AREG engine as a static with MSVC on Windows, enable AREG extensions and logs
61-
- { name: win-msvc-static-ext-log, os: windows-latest, lib: static, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON}
147+
- { name: win-msvc-cl-shared,
148+
os: windows-latest,
149+
lib: shared,
150+
family: msvc,
151+
cxx: cl,
152+
comp: ON,
153+
before: ON
154+
}
155+
62156
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs
63-
- { name: win-msvc-shared-noext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: ON}
64-
# compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs
65-
- { name: win-msvc-shared-noext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: OFF}
157+
- { name: win-msvc-cl-static,
158+
os: windows-latest,
159+
lib: static,
160+
family: msvc,
161+
cxx: cl,
162+
comp: OFF,
163+
before: OFF
164+
}
66165

67166
steps:
68167

69-
- name: Checkout AREG engine (AREG SDK) source codes and dependencies
70-
uses: actions/checkout@v3
168+
- name: Checkout AREG SDK Demo project sources and dependencies
169+
uses: actions/checkout@v4
71170
with:
72171
submodules: recursive
73172

173+
- name: Setup Java JDK to run code generator
174+
uses: actions/[email protected]
175+
with:
176+
java-version: 17
177+
java-package: jre
178+
distribution: temurin
179+
74180
- name: Update compilers on Linux
75181
if: matrix.config.os == 'ubuntu-latest'
76182
# Update compilers, set C/C++ compilers
77-
run: |
78-
sudo apt-get update
79-
export CC=/usr/bin/${{matrix.config.cc}} CXX=/usr/bin/${{matrix.config.cxx}}
183+
run: sudo apt-get update
80184

81-
- name: Fetch cygwin installer on Windows
185+
- name: Set Windows PATH environment variable for cygwin
82186
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
83-
shell: powershell
84-
run: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe
187+
run: echo "PATH=C:\cygwin;C:\cygwin\bin;C:\cygwin\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
85188

86189
- name: Install cygwin on Windows
87190
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
88-
shell: cmd
89-
run: |
90-
c:\setup.exe -qgnO -s http://mirrors.kernel.org/sourceware/cygwin/ -l C:\cygwin-packages\ -P ^
91-
cmake,^
92-
dos2unix,^
93-
extra-cmake-modules,^
94-
flexdll,^
95-
gcc-g++,^
96-
make,^
97-
ncurses,^
98-
libncurses-devel
99-
100-
- name: set Windows PATH environment variable
101-
if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin'
102-
run: echo "PATH=C:\cygwin64;C:\cygwin64\bin;C:\cygwin64\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
103-
104-
- name: Configure CMake with enabled extended feature and selected compiler family
105-
if: matrix.config.extend == 'ON'
191+
uses: cygwin/cygwin-install-action@v4
192+
with:
193+
packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make
194+
195+
- name: Set cmake cache destination for Linux
196+
if: matrix.config.os == 'ubuntu-latest'
197+
run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV"
198+
199+
- name: Set cmake cache destination for Windows
200+
if: matrix.config.os == 'windows-latest'
201+
run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> $env:GITHUB_ENV
202+
203+
- name: Configure CMake and pass compiler option
204+
if: matrix.config.comp == 'ON'
106205
working-directory: ${{github.workspace}}
107206
run: |
108-
cmake -B ./build -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}}
207+
cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER=${{matrix.config.cxx}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}}
109208
110-
- name: Configure CMake for disabled extended feature and selected compiler
111-
if: matrix.config.extend == 'OFF'
209+
- name: Configure CMake and pass compiler family option
210+
if: matrix.config.comp == 'OFF'
112211
working-directory: ${{github.workspace}}
113212
run: |
114-
cmake -B ./build -DAREG_COMPILER=${{matrix.config.cc}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}}
213+
cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}}
115214
116215
- name: Build with CMake
117216
working-directory: ${{github.workspace}}
118217
# Build your program with the given configuration
119-
run: cmake --build ./build -j10
120-
121-
- name: Run Unit Tests
122-
working-directory: ${{github.workspace}}
123-
run: ctest --test-dir ./build --output-on-failure --output-junit test_results.xml
124-
218+
run: cmake --build ${{env.CACHE_DEST}} -j 20

.github/workflows/msbuild.yml

+21-14
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,27 @@ jobs:
5050
- {name: MSBuild-x64-noext-nolog, platform: x64, extend: 0, logs: 0}
5151

5252
steps:
53-
- name: Checkout AREG engine (AREG SDK) source codes and submodules
54-
uses: actions/checkout@v3
55-
with:
56-
submodules: recursive
53+
- name: Checkout AREG SDK Demo project sources and dependencies
54+
uses: actions/checkout@v4
55+
with:
56+
submodules: recursive
5757

58-
- name: Add MSBuild to PATH
59-
uses: microsoft/[email protected]
58+
- name: Setup Java JDK to run code generator
59+
uses: actions/[email protected]
60+
with:
61+
java-version: 17
62+
java-package: jre
63+
distribution: temurin
6064

61-
- name: Restore NuGet packages
62-
working-directory: ${{env.GITHUB_WORKSPACE}}
63-
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
65+
- name: Add MSBuild to PATH
66+
uses: microsoft/setup-msbuild@v2
6467

65-
- name: Build areg-sdk solution.
66-
working-directory: ${{env.GITHUB_WORKSPACE}}
67-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
68-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
69-
run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}}
68+
- name: Restore NuGet packages
69+
working-directory: ${{env.GITHUB_WORKSPACE}}
70+
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
71+
72+
- name: Build areg-sdk solution.
73+
working-directory: ${{env.GITHUB_WORKSPACE}}
74+
# Add additional options to the MSBuild command line here (like platform or verbosity level).
75+
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
76+
run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}}

0 commit comments

Comments
 (0)