Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add languagestandard variable to cmake template #208

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: cmake

on:
push:
pull_request:
schedule:
- cron: '0 1 * * SUN'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-12
CXX: g++-12
PackageDeps: g++-12
os: ubuntu-22.04
- CC: vs2019
CXX: vs2019
os: windows-2019
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.CXX }}
env:
DOC_ROOT: ${{ github.workspace }}/ACE_TAO
ACE_ROOT: ${{ github.workspace }}/ACE_TAO/ACE
MPC_ROOT: ${{ github.workspace }}/
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
steps:
- name: checkout MPC
uses: actions/checkout@v4
- name: checkout ACE_TAO
uses: actions/checkout@v4
with:
repository: DOCGroup/ACE_TAO
path: ${{ env.DOC_ROOT }}
- name: Add Repo
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ ${{ matrix.Repo }} main"
if: matrix.Repo != ''
- name: Add packages
run: |
sudo apt-get --yes update
sudo apt-get --yes install ${{ matrix.PackageDeps }}
if: matrix.PackageDeps != ''
- name: create $ACE_ROOT/ace/config.h
run: |
'#ifdef linux' > ${env:ACE_ROOT}/ace/config.h
'# include "ace/config-linux.h"' >> ${env:ACE_ROOT}/ace/config.h
'#else' >> ${env:ACE_ROOT}/ace/config.h
'# include "ace/config-win32.h"' >> ${env:ACE_ROOT}/ace/config.h
'#endif' >> ${env:ACE_ROOT}/ace/config.h
shell: pwsh
- name: Run mwc.pl on $(ACE_ROOT)/ace/ace.mwc
run: |
perl ${env:ACE_ROOT}/bin/mwc.pl -type cmake ${env:ACE_ROOT}/ace/ace.mwc -workers 6
shell: pwsh
- name: Run mwc.pl on $(ACE_ROOT)/apps/gperf/src
run: |
perl ${env:ACE_ROOT}/bin/mwc.pl -type cmake ${env:ACE_ROOT}/apps/gperf/src
shell: pwsh
- name: Build ace project
run: |
cd ${env:ACE_ROOT}/ace
cmake -S . -B build
cmake --build build -j6
shell: pwsh
- name: Build ACE/apps/gperf/src project
run: |
cd ${env:ACE_ROOT}/apps/gperf/src
cmake -S . -B build
cmake --build build -j6
shell: pwsh
1 change: 1 addition & 0 deletions docs/templates/cmake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ env_libout = The value of 'libout' with $() values converted to $ENV{}.
env_libpaths = The value of 'libpaths' with $() values converted to $ENV{}.
packages = A list of packages to be used with the find_package() command.
pre_find_package = A specific command or set of commands to be issued before any find_package() commands are called.
languagestandard = Which version of ISO C++ standard to compile against (14, 17, 20)
4 changes: 4 additions & 0 deletions templates/cmake.mpd
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ set_target_properties(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PROPERTI
<%endif%>
<%endfor%>
<%endif%>
<%endif%>
<%if(languagestandard)%>
target_compile_features(${PROJECT_TARGET_<%uc(normalize(project_name))%>} PUBLIC "cxx_std_<%languagestandard%>")

<%endif%>

if(CMAKE_CONFIGURATION_TYPES)
Expand Down