diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6c024f051e0..8010ac7c594 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,4 +1,4 @@ -name: "Build & Test" +name: "MPC Builds" on: push: @@ -13681,305 +13681,3 @@ jobs: with: name: ${{ github.job }}_artifact path: ${{ github.job }}.tar.xz - - build_cmake_u22: - - runs-on: ubuntu-22.04 - - steps: - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE/TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - path: OpenDDS/build/ACE_TAO - - name: Install xerces - run: sudo apt-get -y install libxerces-c-dev - - name: Configure - run: | - cd OpenDDS - cmake -B build \ - -DCMAKE_UNITY_BUILD=TRUE \ - -DBUILD_SHARED_LIBS=TRUE \ - -DCMAKE_BUILD_TYPE=Debug \ - -DOPENDDS_SECURITY=TRUE \ - -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ - -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ - -DOPENDDS_BUILD_TESTS=TRUE \ - -DOPENDDS_CMAKE_VERBOSE=all - - uses: ammaraskar/gcc-problem-matcher@0.3.0 - - name: Build - run: | - cd OpenDDS - cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) - - name: Run Tests - run: | - cd OpenDDS/build - ctest - - build_cmake_u22_stat: - - runs-on: ubuntu-22.04 - - steps: - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE/TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - path: OpenDDS/build/ACE_TAO - - name: Configure - run: | - cd OpenDDS - cmake -B build \ - -DCMAKE_UNITY_BUILD=TRUE \ - -DBUILD_SHARED_LIBS=FALSE \ - -DCMAKE_BUILD_TYPE=Debug \ - -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ - -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ - -DOPENDDS_BUILD_TESTS=TRUE \ - -DOPENDDS_CMAKE_VERBOSE=all - - uses: ammaraskar/gcc-problem-matcher@0.3.0 - - name: Build - run: | - cd OpenDDS - cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) - - name: Run Tests - run: | - cd OpenDDS/build - ctest - - build_cmake_u22_no_features: - - runs-on: ubuntu-22.04 - - steps: - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE/TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - path: OpenDDS/build/ACE_TAO - - name: Install Ninja - run: sudo apt-get -y install ninja-build - - name: Configure - run: | - cd OpenDDS - cmake -B build \ - -G Ninja \ - -DCMAKE_UNITY_BUILD=TRUE \ - -DBUILD_SHARED_LIBS=TRUE \ - -DCMAKE_BUILD_TYPE=Debug \ - -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ - -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ - -DOPENDDS_BUILD_TESTS=TRUE \ - -DOPENDDS_BUILT_IN_TOPICS=FALSE \ - -DOPENDDS_OBJECT_MODEL_PROFILE=FALSE \ - -DOPENDDS_PERSISTENCE_PROFILE=FALSE \ - -DOPENDDS_OWNERSHIP_PROFILE=FALSE \ - -DOPENDDS_CONTENT_SUBSCRIPTION=FALSE \ - -DOPENDDS_CMAKE_VERBOSE=all - - uses: ammaraskar/gcc-problem-matcher@0.3.0 - - name: Build - run: | - cd OpenDDS - cmake --build build - - name: Run Tests - run: | - cd OpenDDS/build - ctest - - build_cmake_u22_android29: - - runs-on: ubuntu-22.04 - - steps: - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r25c - add-to-path: false - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE/TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - path: OpenDDS/build/ACE_TAO - - name: Install Ninja - run: sudo apt-get -y install ninja-build - - name: Configure Host Tools - run: | - cd OpenDDS - cmake -B build-host \ - -G Ninja \ - -DBUILD_SHARED_LIBS=FALSE \ - -DOPENDDS_JUST_BUILD_HOST_TOOLS=TRUE - - uses: ammaraskar/gcc-problem-matcher@0.3.0 - - name: Build Host Tools - run: | - cd OpenDDS - cmake --build build-host - - name: Configure Target - run: | - cd OpenDDS - cmake -B build-target \ - -G Ninja \ - -DBUILD_SHARED_LIBS=TRUE \ - -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-29 \ - --toolchain ${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ - -DOPENDDS_CMAKE_VERBOSE=all \ - -DOPENDDS_HOST_TOOLS=$(realpath build-host) - - name: Build Target - run: | - cd OpenDDS - cmake --build build-target - - build_cmake_w22: - - runs-on: windows-2022 - - needs: ACE_TAO_w22_p1 - - steps: - - name: setup for run-vcpkg - shell: bash - run: | - echo '{ "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] }' > vcpkg.json - - name: install openssl & xerces-c - uses: lukka/run-vcpkg@v11 - with: - vcpkgGitCommitId: '${{ env.VCPKG_GIT_COMMIT }}' - runVcpkgInstall: true - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE_TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - ref: ace6tao2 - path: OpenDDS/ACE_TAO - - name: Download ACE_TAO artifact - uses: actions/download-artifact@v4 - with: - name: ACE_TAO_w22_p1_artifact - path: OpenDDS/ACE_TAO - - name: Extract ACE_TAO artifact - shell: bash - run: | - cd OpenDDS/ACE_TAO - tar xvfJ ACE_TAO_w22_p1.tar.xz - rm -f ACE_TAO_w22_p1.tar.xz - - name: set up msvc env - uses: ilammy/msvc-dev-cmd@v1 - - name: Configure - shell: cmd - run: | - cd OpenDDS - cmake -B build^ - -DBUILD_SHARED_LIBS=TRUE^ - -DCMAKE_BUILD_TYPE=Debug^ - -DOPENDDS_ACE=${{ github.workspace }}\OpenDDS\ACE_TAO\ACE^ - -DOPENDDS_MPC=${{ github.workspace }}\MPC^ - -DOPENDDS_BUILD_TESTS=TRUE^ - -DOPENDDS_CMAKE_VERBOSE=all - - uses: ammaraskar/msvc-problem-matcher@0.3.0 - - name: Build - shell: cmd - run: | - cd OpenDDS - cmake --build build - - name: Run Tests - shell: cmd - run: | - cd OpenDDS\build - ctest -C Debug - - build_cmake_w22_stat: - - runs-on: windows-2022 - - steps: - - name: Checkout OpenDDS - uses: actions/checkout@v4 - with: - path: OpenDDS - submodules: true - - name: Checkout MPC - uses: actions/checkout@v4 - with: - repository: DOCGroup/MPC - path: MPC - - name: Checkout ACE/TAO - uses: actions/checkout@v4 - with: - repository: DOCGroup/ACE_TAO - path: OpenDDS/build/ACE_TAO - - name: set up msvc env - uses: ilammy/msvc-dev-cmd@v1 - - name: Configure - shell: cmd - run: | - cd OpenDDS - cmake -B build^ - -DCMAKE_UNITY_BUILD=TRUE^ - -DBUILD_SHARED_LIBS=FALSE^ - -DCMAKE_BUILD_TYPE=Debug^ - -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ - -DOPENDDS_MPC=${{ github.workspace }}\MPC^ - -DOPENDDS_BUILD_TESTS=TRUE^ - -DOPENDDS_CMAKE_VERBOSE=all - - uses: ammaraskar/msvc-problem-matcher@0.3.0 - - name: Build - shell: cmd - run: | - cd OpenDDS - cmake --build build - - name: Run Tests - shell: cmd - run: | - cd OpenDDS\build - ctest -C Debug diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000000..2557bcaada1 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,448 @@ +name: "CMake Builds" + +on: + push: + paths: + - '**' + # Don't run this workflow if the only files that changed are the + # following. Make sure this is the same as the "pull_request.paths" list. + - '!AUTHORS' + - '!PROBLEM-REPORT-FORM' + - '!LICENSE' + - '!Dockerfile**' + - '!.dockerignore' + - '!.mailmap' + - '!.github/workflows/lint.yml' + - '!.github/workflows/sphinx_strict.yml' + - '!etc/**' + - '!docs/**' + - '!hooks/**' + - '!tools/scripts/gitrelease.pl' + - '!tools/scripts/lint.pl' + - '!**.md' + - '!**.rst' + - '!**/.gitignore' + - '!**/.lint_config' + - '!**/README*' + pull_request: + paths: + - '**' + # Don't run this workflow if the only files that changed are the + # following. Make sure this is the same as the "push.paths" list. + - '!AUTHORS' + - '!PROBLEM-REPORT-FORM' + - '!LICENSE' + - '!Dockerfile**' + - '!.dockerignore' + - '!.mailmap' + - '!.github/workflows/lint.yml' + - '!.github/workflows/sphinx_strict.yml' + - '!etc/**' + - '!docs/**' + - '!hooks/**' + - '!tools/scripts/gitrelease.pl' + - '!tools/scripts/lint.pl' + - '!**.md' + - '!**.rst' + - '!**/.gitignore' + - '!**/.lint_config' + - '!**/README*' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + TRIGGERING_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + VCPKG_INSTALLED_DIR: ${{ github.workspace }}\vcpkg\installed + CTEST_OUTPUT_ON_FAILURE: ON + VCPKG_GIT_COMMIT: 898b728edc5e0d12b50015f9cd18247c4257a3eb + +jobs: + u22: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Install xerces + run: sudo apt-get -y install libxerces-c-dev + - name: Configure + run: | + cd OpenDDS + cmake -B build \ + -DCMAKE_UNITY_BUILD=TRUE \ + -DBUILD_SHARED_LIBS=TRUE \ + -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_SECURITY=TRUE \ + -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ + -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ + -DOPENDDS_BUILD_TESTS=TRUE \ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/gcc-problem-matcher@0.3.0 + - name: Build + run: | + cd OpenDDS + cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) + - name: Run Tests + run: | + cd OpenDDS/build + ctest + + u22_stat: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Configure + run: | + cd OpenDDS + cmake -B build \ + -DCMAKE_UNITY_BUILD=TRUE \ + -DBUILD_SHARED_LIBS=FALSE \ + -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ + -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ + -DOPENDDS_BUILD_TESTS=TRUE \ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/gcc-problem-matcher@0.3.0 + - name: Build + run: | + cd OpenDDS + cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) + - name: Run Tests + run: | + cd OpenDDS/build + ctest + + u22_no_features: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Install Ninja + run: sudo apt-get -y install ninja-build + - name: Configure + run: | + cd OpenDDS + cmake -B build \ + -G Ninja \ + -DCMAKE_UNITY_BUILD=TRUE \ + -DBUILD_SHARED_LIBS=TRUE \ + -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ + -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ + -DOPENDDS_BUILD_TESTS=TRUE \ + -DOPENDDS_BUILT_IN_TOPICS=FALSE \ + -DOPENDDS_OBJECT_MODEL_PROFILE=FALSE \ + -DOPENDDS_PERSISTENCE_PROFILE=FALSE \ + -DOPENDDS_OWNERSHIP_PROFILE=FALSE \ + -DOPENDDS_CONTENT_SUBSCRIPTION=FALSE \ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/gcc-problem-matcher@0.3.0 + - name: Build + run: | + cd OpenDDS + cmake --build build + - name: Run Tests + run: | + cd OpenDDS/build + ctest + + u22_android29: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r25c + add-to-path: false + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Install Ninja + run: sudo apt-get -y install ninja-build + - name: Configure Host Tools + run: | + cd OpenDDS + cmake -B build-host \ + -G Ninja \ + -DBUILD_SHARED_LIBS=FALSE \ + -DOPENDDS_JUST_BUILD_HOST_TOOLS=TRUE + - uses: ammaraskar/gcc-problem-matcher@0.3.0 + - name: Build Host Tools + run: | + cd OpenDDS + cmake --build build-host + - name: Configure Target + run: | + cd OpenDDS + cmake -B build-target \ + -G Ninja \ + -DBUILD_SHARED_LIBS=TRUE \ + -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-29 \ + --toolchain ${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ + -DOPENDDS_CMAKE_VERBOSE=all \ + -DOPENDDS_HOST_TOOLS=$(realpath build-host) + - name: Build Target + run: | + cd OpenDDS + cmake --build build-target + + w22: + + runs-on: windows-2022 + + steps: + - name: setup for run-vcpkg + shell: bash + run: | + echo '{ "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] }' > vcpkg.json + - name: install openssl & xerces-c + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: '${{ env.VCPKG_GIT_COMMIT }}' + runVcpkgInstall: true + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE_TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + ref: ace6tao2 + path: OpenDDS/ACE_TAO + - name: set up msvc env + uses: ilammy/msvc-dev-cmd@v1 + - name: Configure + shell: cmd + run: | + cd OpenDDS + cmake -B build^ + -DBUILD_SHARED_LIBS=TRUE^ + -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ + -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_BUILD_TESTS=TRUE^ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/msvc-problem-matcher@0.3.0 + - name: Build + shell: cmd + run: | + cd OpenDDS + cmake --build build --config Debug + - name: Run Tests + shell: cmd + run: | + cd OpenDDS\build + ctest -C Debug + + w22_stat: + + runs-on: windows-2022 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: set up msvc env + uses: ilammy/msvc-dev-cmd@v1 + - name: Configure + shell: cmd + run: | + cd OpenDDS + cmake -B build^ + -DCMAKE_UNITY_BUILD=TRUE^ + -DBUILD_SHARED_LIBS=FALSE^ + -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ + -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_BUILD_TESTS=TRUE^ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/msvc-problem-matcher@0.3.0 + - name: Build + shell: cmd + run: | + cd OpenDDS + cmake --build build --config Debug + - name: Run Tests + shell: cmd + run: | + cd OpenDDS\build + ctest -C Debug + + w22_rel: + + runs-on: windows-2022 + + steps: + - name: setup for run-vcpkg + shell: bash + run: | + echo '{ "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] }' > vcpkg.json + - name: install openssl & xerces-c + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: '${{ env.VCPKG_GIT_COMMIT }}' + runVcpkgInstall: true + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE_TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + ref: ace6tao2 + path: OpenDDS/ACE_TAO + - name: set up msvc env + uses: ilammy/msvc-dev-cmd@v1 + - name: Configure + shell: cmd + run: | + cd OpenDDS + cmake -B build^ + -DCMAKE_UNITY_BUILD=TRUE^ + -DBUILD_SHARED_LIBS=TRUE^ + -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ + -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_BUILD_TESTS=TRUE^ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/msvc-problem-matcher@0.3.0 + - name: Build + shell: cmd + run: | + cd OpenDDS + cmake --build build --config Release + - name: Run Tests + shell: cmd + run: | + cd OpenDDS\build + ctest -C Release + + w22_rel_stat: + + runs-on: windows-2022 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v4 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v4 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v4 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: set up msvc env + uses: ilammy/msvc-dev-cmd@v1 + - name: Configure + shell: cmd + run: | + cd OpenDDS + cmake -B build^ + -DCMAKE_UNITY_BUILD=TRUE^ + -DBUILD_SHARED_LIBS=FALSE^ + -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ + -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_BUILD_TESTS=TRUE^ + -DOPENDDS_CMAKE_VERBOSE=all + - uses: ammaraskar/msvc-problem-matcher@0.3.0 + - name: Build + shell: cmd + run: | + cd OpenDDS + cmake --build build --config Release + - name: Run Tests + shell: cmd + run: | + cd OpenDDS\build + ctest -C Release diff --git a/cmake/build_ace_tao.cmake b/cmake/build_ace_tao.cmake index 9472e718688..843d63935ed 100644 --- a/cmake/build_ace_tao.cmake +++ b/cmake/build_ace_tao.cmake @@ -108,8 +108,19 @@ elseif(_OPENDDS_MPC_TYPE MATCHES "^vs") foreach(member_index RANGE ${member_index_end}) string(JSON member_name MEMBER "${mpc_projects}" ${member_index}) string(JSON mpc_project GET "${mpc_projects}" ${member_name}) - string(JSON file GET "${mpc_project}" loc) - list(APPEND byproducts "${file}") + string(JSON configs ERROR_VARIABLE err GET "${mpc_project}" "configs") + if(configs) + string(JSON config_index_end LENGTH "${configs}") + math(EXPR config_index_end "${config_index_end} - 1") + foreach(config_index RANGE ${config_index_end}) + string(JSON config_name MEMBER "${configs}" ${config_index}) + string(JSON path GET "${configs}" ${config_name}) + list(APPEND byproducts "${path}") + endforeach() + else() + string(JSON path GET "${mpc_project}" "loc") + list(APPEND byproducts "${path}") + endif() endforeach() ExternalProject_Add(build_ace_tao diff --git a/cmake/import_common.cmake b/cmake/import_common.cmake index 874fbbb9bcb..07a729233bd 100644 --- a/cmake/import_common.cmake +++ b/cmake/import_common.cmake @@ -101,7 +101,7 @@ function(_opendds_group_exe name) set("${prefix}_BIN_DIRS" "${bin_dirs}" PARENT_SCOPE) endfunction() -function(_opendds_find_in_mpc_projects found_var path_var mpc_projects mpc_name) +function(_opendds_find_in_mpc_projects found_var path_var mpc_projects mpc_name config) string(JSON mpc_project ERROR_VARIABLE err GET "${mpc_projects}" "${mpc_name}") if(NOT mpc_project) set(${found_var} FALSE CACHE INTERNAL "" FORCE) @@ -110,7 +110,12 @@ function(_opendds_find_in_mpc_projects found_var path_var mpc_projects mpc_name) endif() return() endif() - string(JSON path GET "${mpc_project}" "loc") + string(JSON configs ERROR_VARIABLE err GET "${mpc_project}" "configs") + if(config AND configs) + string(JSON path GET "${configs}" "${config}") + else() + string(JSON path GET "${mpc_project}" "loc") + endif() if(NOT CMAKE_GENERATOR STREQUAL "Ninja" AND NOT IS_ABSOLUTE "${path}") cmake_path(ABSOLUTE_PATH path BASE_DIRECTORY "${OPENDDS_BUILD_DIR}") endif() @@ -134,6 +139,7 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) endif() string(TOUPPER "_OPENDDS_${group}" group_prefix) + string(TOUPPER "${config}" config_upper) if(MSVC AND OPENDDS_STATIC) set(suffix "s${suffix}") @@ -149,7 +155,7 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) set(lib_file_base "${lib}${suffix}") string(TOUPPER "${group_prefix}_${short_name}" lib_prefix) string(TOUPPER "${lib}" upper) - set(lib_var "${upper}_LIBRARY_${config}") + set(lib_var "${upper}_LIBRARY_${config_upper}") set(found_var "${upper}_LIBRARY_FOUND") string(TOUPPER "${group}_IS_BEING_BUILT" group_is_being_built_var) set(group_is_being_built "${${group_is_being_built_var}}") @@ -168,7 +174,7 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") if(DEFINED "${mpc_projects_var}") _opendds_find_in_mpc_projects( - "${found_var}" "${lib_var}" "${${mpc_projects_var}}" "${${lib_prefix}_MPC_NAME}") + "${found_var}" "${lib_var}" "${${mpc_projects_var}}" "${${lib_prefix}_MPC_NAME}" ${config}) if(${${found_var}}) if(debug) message(STATUS "${config} lib ${target} assumed: ${${lib_var}}") @@ -206,7 +212,7 @@ function(_opendds_find_our_libraries_for_config group libs config suffix) # IMPORTED_RUNTIME_ARTIFACTS to work correctly. find_file("${lib_var}_DLL" "${lib_file_base}.dll" HINTS "${lib_dir}") endif() - elseif(NOT DEFINED ${found_var}) + elseif(NOT CMAKE_CONFIGURATION_TYPES AND NOT DEFINED ${found_var}) if(debug) message(STATUS "${config} lib ${target} NOT FOUND") endif() @@ -243,7 +249,7 @@ function(_opendds_find_executables group exes) set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") if(DEFINED "${mpc_projects_var}" AND NOT ${var}_HOST_TOOL) _opendds_find_in_mpc_projects( - "${found_var}" "${var}" "${${mpc_projects_var}}" "${${var}_MPC_NAME}") + "${found_var}" "${var}" "${${mpc_projects_var}}" "${${var}_MPC_NAME}" "") if(${${found_var}}) if(debug) message(STATUS "exe ${target} assumed: ${${var}}") @@ -263,13 +269,13 @@ endfunction() # Needs to be a macro because of select_library_configurations macro(_opendds_find_group_targets group libs exes) - if(MSVC) - _opendds_find_our_libraries_for_config(${group} "${libs}" "RELEASE" "") - _opendds_find_our_libraries_for_config(${group} "${libs}" "DEBUG" "d") + if(CMAKE_CONFIGURATION_TYPES) + _opendds_find_our_libraries_for_config(${group} "${libs}" "Release" "") + _opendds_find_our_libraries_for_config(${group} "${libs}" "Debug" "d") elseif(OPENDDS_DEBUG) - _opendds_find_our_libraries_for_config(${group} "${libs}" "DEBUG" "") + _opendds_find_our_libraries_for_config(${group} "${libs}" "Debug" "") else() - _opendds_find_our_libraries_for_config(${group} "${libs}" "RELEASE" "") + _opendds_find_our_libraries_for_config(${group} "${libs}" "Release" "") endif() foreach(_lib ${libs}) @@ -305,6 +311,14 @@ function(_opendds_import_group_targets group libs exes) string(TOUPPER "${group}" group_upper) set(group_prefix "_OPENDDS_${group_upper}") + function(set_imported_prop target config prop value) + if(NOT CMAKE_CONFIGURATION_TYPES) + set_target_properties(${target} PROPERTIES ${prop} "${value}") + endif() + set(prop "${prop}_${config}") + set_target_properties(${target} PROPERTIES ${prop} "${value}") + endfunction() + macro(add_target_library_config target var_prefix config) set(lib_var "${var_prefix}_LIBRARY_${config}") set(lib_file "${${lib_var}}") @@ -329,20 +343,14 @@ function(_opendds_import_group_targets group libs exes) set(imploc "${lib_file}") if(MSVC) - set_target_properties(${target} - PROPERTIES - "IMPORTED_IMPLIB_${config}" "${lib_file}" - ) + set_imported_prop(${target} ${config} IMPORTED_IMPLIB "${lib_file}") set(dll "${lib_var}_DLL") if(DEFINED "${dll}") set(imploc "${${dll}}") endif() endif() - set_target_properties(${target} - PROPERTIES - "IMPORTED_LINK_INTERFACE_LANGUAGES_${config}" "CXX" - "IMPORTED_LOCATION_${config}" "${imploc}" - ) + set_imported_prop(${target} ${config} IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") + set_imported_prop(${target} ${config} IMPORTED_LOCATION "${imploc}") endif() endmacro() @@ -369,7 +377,7 @@ function(_opendds_import_group_targets group libs exes) add_dependencies(${target} "${${mpc_ext_proj_var}}") endif() - if(MSVC) + if(CMAKE_CONFIGURATION_TYPES) add_target_library_config(${target} ${var_prefix} "RELEASE") add_target_library_config(${target} ${var_prefix} "DEBUG") elseif(OPENDDS_DEBUG) diff --git a/cmake/scrape_vs.pl b/cmake/scrape_vs.pl index 829a2a07df8..9443dab3115 100755 --- a/cmake/scrape_vs.pl +++ b/cmake/scrape_vs.pl @@ -45,15 +45,19 @@ my $name = $1; my $pf = File::Spec->catfile(dirname($values{sln}), $2); - my $loc = undef; + my %configs; + my $config; open(my $pf_fh, $pf) or die("Couldn't open \"$pf\": $!"); while (my $pf_line = <$pf_fh>) { $pf_line =~ s/\s$//; - if ($pf_line =~ /(\$\(\w+\))?(.*)<\/OutputFile>$/) { + if ($pf_line =~ /$/) { + $config = $1; + } + elsif ($pf_line =~ /(\$\(\w+\))?(.*)<\/OutputFile>$/) { my $base_var = $1; my $output_file = $2; - $output_file =~ s/d?\.dll/d.dll/; $output_file =~ s/\.dll$/.lib/; + my $loc; if ($base_var) { if ($base_var eq '$(OutDir)') { $loc = File::Spec->catfile( @@ -69,19 +73,32 @@ else { $loc = File::Spec->catfile(dirname($pf), $output_file); } - last; + + if ($loc && $config) { + $configs{$config} = $loc; + $config = undef; + } } } - if (!defined($loc)) { - # print STDERR ("Didn't get OutputFile from $pf\n"); - next; + if (!%configs) { + next; } - # print STDERR ("$name $pf $loc\n"); - $projects{$name} = { - name => $name, - loc => $loc, - }; + my @locs = values(%configs); + my $loc = $locs[0]; + if (@locs == grep { $_ eq $loc } @locs) { + # The locations are the same for each config + $projects{$name} = { + name => $name, + loc => $loc, + }; + } + else { + $projects{$name} = { + name => $name, + configs => \%configs, + }; + } } } diff --git a/docs/news.d/cmake-windows-release-config.rst b/docs/news.d/cmake-windows-release-config.rst new file mode 100644 index 00000000000..0d5f8805a53 --- /dev/null +++ b/docs/news.d/cmake-windows-release-config.rst @@ -0,0 +1,7 @@ +.. news-prs: 4535 + +.. news-start-section: Platform Support and Dependencies +.. news-start-section: Building with CMake +- Fixed :ghissue:`building release builds on Windows at the same time as ACE/TAO <4531>` +.. news-end-section +.. news-end-section diff --git a/docs/news.d/openddsconfig.rst b/docs/news.d/openddsconfig.rst index 9bb9a511243..b0f6f5ae4af 100644 --- a/docs/news.d/openddsconfig.rst +++ b/docs/news.d/openddsconfig.rst @@ -3,8 +3,7 @@ .. news-start-section: Additions - A new header, ``dds/OpenDDSConfig.h`` is generated by configure or CMake. - - Users manually configuring a build will need to create this file, which may be empty, or - add the define ``OPENDDS_IGNORE_OPENDDSCONFIG_H_FILE`` to their ``ace/config.h`` file. - - See ``dds/OpenDDSConfig.h.in`` for details. + - Users manually configuring a build will need to create this file, which may be empty, or add ``#define OPENDDS_IGNORE_OPENDDSCONFIG_H_FILE`` to their ``ace/config.h`` file. + - See :ghfile:`dds/OpenDDSConfig.h.in` for details. .. news-end-section