Skip to content

Commit 1455e0e

Browse files
committed
Add languagestandard variable
* .github/workflows/cmake.yml: Added. * docs/templates/cmake.txt: * templates/cmake.mpd:
1 parent 1b8cdf5 commit 1455e0e

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

.github/workflows/cmake.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: cmake
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 1 * * SUN'
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- CC: gcc-12
24+
CXX: g++-12
25+
PackageDeps: g++-12
26+
os: ubuntu-22.04
27+
- CC: vs2019
28+
CXX: vs2019
29+
os: windows-2019
30+
runs-on: ${{ matrix.os }}
31+
name: ${{ matrix.os }} ${{ matrix.CXX }}
32+
env:
33+
DOC_ROOT: ${{ github.workspace }}/ACE_TAO
34+
ACE_ROOT: ${{ github.workspace }}/ACE_TAO/ACE
35+
MPC_ROOT: ${{ github.workspace }}/
36+
CC: ${{ matrix.CC }}
37+
CXX: ${{ matrix.CXX }}
38+
steps:
39+
- name: checkout MPC
40+
uses: actions/checkout@v4
41+
- name: checkout ACE_TAO
42+
uses: actions/checkout@v4
43+
with:
44+
repository: DOCGroup/ACE_TAO
45+
path: ${{ env.DOC_ROOT }}
46+
- name: Add Repo
47+
run: |
48+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
49+
sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ ${{ matrix.Repo }} main"
50+
if: matrix.Repo != ''
51+
- name: Add packages
52+
run: |
53+
sudo apt-get --yes update
54+
sudo apt-get --yes install ${{ matrix.PackageDeps }}
55+
if: matrix.PackageDeps != ''
56+
- name: create $ACE_ROOT/ace/config.h
57+
run: |
58+
'#ifdef linux' > ${env:ACE_ROOT}/ace/config.h
59+
'# include "ace/config-linux.h"' >> ${env:ACE_ROOT}/ace/config.h
60+
'#else' >> ${env:ACE_ROOT}/ace/config.h
61+
'# include "ace/config-win32.h"' >> ${env:ACE_ROOT}/ace/config.h
62+
'#endif' >> ${env:ACE_ROOT}/ace/config.h
63+
shell: pwsh
64+
- name: Run mwc.pl on $(ACE_ROOT)/ace/ace.mwc
65+
run: |
66+
perl ${env:ACE_ROOT}/bin/mwc.pl -type cmake ${env:ACE_ROOT}/ace/ace.mwc -workers 6
67+
shell: pwsh
68+
- name: Run mwc.pl on $(ACE_ROOT)/apps/gperf/src
69+
run: |
70+
perl ${env:ACE_ROOT}/bin/mwc.pl -type cmake ${env:ACE_ROOT}/apps/gperf/src
71+
shell: pwsh
72+
- name: Build ace project
73+
run: |
74+
cd ${env:ACE_ROOT}/ace
75+
cmake -S . -B build
76+
cmake --build build -j6
77+
shell: pwsh
78+
- name: Build ACE/apps/gperf/src project
79+
run: |
80+
cd ${env:ACE_ROOT}/apps/gperf/src
81+
cmake -S . -B build
82+
cmake --build build -j6
83+
shell: pwsh

docs/templates/cmake.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ env_libout = The value of 'libout' with $() values converted to $ENV{}.
1515
env_libpaths = The value of 'libpaths' with $() values converted to $ENV{}.
1616
packages = A list of packages to be used with the find_package() command.
1717
pre_find_package = A specific command or set of commands to be issued before any find_package() commands are called.
18+
languagestandard = Which version of ISO C++ standard to compile against (14, 17, 20)

templates/cmake.mpd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_<%uc(configuration)%> <%env_libout%>)
7979
<%endif%>
8080
<%endif%>
8181

82+
<%if(languagestandard)%>
83+
target_compile_features(${target} PUBLIC "cxx_std_<%languagestandard%>")
84+
85+
<%endif%>
8286
<%if(compile_flags)%>
8387
target_compile_options(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC <%compile_flags%>)
8488

0 commit comments

Comments
 (0)