diff options
author | ocielliottc <elliottc@objectcomputing.com> | 2023-01-06 11:33:42 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 11:33:42 -0600 |
commit | f1147ca3775d8223ca47849f940a86c540a9495b (patch) | |
tree | cb72378f5ac426e1fccf26668d1310f21849f8a4 | |
parent | 74d6be186ce2584855e99df9ba08f54c1e2e18b2 (diff) | |
parent | d7cc4836355744f9c5361e725d1fd01e984a81a4 (diff) | |
download | ATCD-f1147ca3775d8223ca47849f940a86c540a9495b.tar.gz |
Merge pull request #2009 from ocielliottc/cmake-support
CMake Support for the ACE core
-rw-r--r-- | .github/workflows/cmake.yml | 82 | ||||
-rw-r--r-- | ACE/ace/Monitor_Control/Monitor_Control.mpc | 5 | ||||
-rw-r--r-- | ACE/bin/MakeProjectCreator/config/acedefaults.mpb | 6 | ||||
-rw-r--r-- | ACE/bin/MakeProjectCreator/config/vc_warnings.mpb | 20 |
4 files changed, 113 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000000..fdd9bd83900 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,82 @@ +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: + ACE_ROOT: ${{ github.workspace }}/ACE + MPC_ROOT: ${{ github.workspace }}/MPC + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + steps: + - name: checkout ACE/TAO + uses: actions/checkout@v3 + - name: checkout MPC + uses: actions/checkout@v3 + with: + repository: DOCGroup/MPC + path: ${{ env.MPC_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 diff --git a/ACE/ace/Monitor_Control/Monitor_Control.mpc b/ACE/ace/Monitor_Control/Monitor_Control.mpc index a13930e845e..11366c50ada 100644 --- a/ACE/ace/Monitor_Control/Monitor_Control.mpc +++ b/ACE/ace/Monitor_Control/Monitor_Control.mpc @@ -48,4 +48,9 @@ project(Monitor_Control) : acelib, ace_etcl_parser, ace_output, install { " ACE_SHLIBS += pdh.lib" "endif" } + verbatim (cmake, top, 1) { + "if (WIN32)" + " link_libraries(pdh)" + "endif()" + } } diff --git a/ACE/bin/MakeProjectCreator/config/acedefaults.mpb b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb index bc94d321425..c90509cecf5 100644 --- a/ACE/bin/MakeProjectCreator/config/acedefaults.mpb +++ b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb @@ -18,6 +18,12 @@ project: ipv6, vc_warnings, build_files, test_files, svc_conf_files, ace_unicode specific(prop:windows) { lit_libs += iphlpapi } + verbatim(cmake, top, 1) { + set(ACE_ROOT $ENV{ACE_ROOT}) + if(WIN32) + " link_libraries(iphlpapi)" + endif() + } specific(cdt6) { win32::platform_libs += ws2_32 mswsock netapi32 diff --git a/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb b/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb index a98185375e1..b951e280931 100644 --- a/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb +++ b/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb @@ -11,24 +11,44 @@ feature(vc_avoid_crt_secure_warnings) { specific(prop:microsoft) { macros += _CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE } + verbatim(cmake, macros, 1) { + if(MSVC) + " add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)" + endif() + } } feature(!vc_scl_secure_warnings) { specific(prop:microsoft) { macros += _SCL_SECURE_NO_WARNINGS } + verbatim(cmake, macros, 1) { + if(MSVC) + " add_compile_definitions(_SCL_SECURE_NO_WARNINGS)" + endif() + } } feature(vc_avoid_this_in_initializer_warnings) { specific(prop:microsoft) { DisableSpecificWarnings += 4355 } + verbatim(cmake, macros, 1) { + if(MSVC) + " add_compile_options(/wd4355)" + endif() + } } feature(vc_avoid_winsock_warnings) { specific(prop:microsoft) { macros += _WINSOCK_DEPRECATED_NO_WARNINGS } + verbatim(cmake, macros, 1) { + if(MSVC) + " add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)" + endif() + } } feature(vc_avoid_hides_local_declaration) { |