From b51cea507f09abcb37043f8efe13a7b111336cf4 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Mon, 18 Sep 2023 10:53:21 -0500 Subject: [PATCH] Add Android CMake to GHA, Fix Building ACE/TAO --- .github/workflows/build_and_test.yml | 101 +++++++++++++++++++++++++++ CMakeLists.txt | 8 ++- cmake/configure_ace_tao.pl | 4 +- cmake/import_common.cmake | 2 +- dds/CMakeLists.txt | 1 - 5 files changed, 109 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 25cdd99cefe..d071f751504 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -12691,3 +12691,104 @@ jobs: run: | cd OpenDDS cmake --build build -t test + + build_cmake_u22_no_features: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v3 + with: + path: OpenDDS + submodules: true + - name: Checkout MPC + uses: actions/checkout@v3 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v3 + 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=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_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.2.0 + - name: Build + run: | + cd OpenDDS + cmake --build build -- -j $(getconf _NPROCESSORS_ONLN) + - name: Run Tests + run: | + cd OpenDDS + cmake --build build -t test + + build_cmake_u22_android29: + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout OpenDDS + uses: actions/checkout@v3 + with: + path: OpenDDS + submodules: true + - uses: nttld/setup-ndk@v1 + with: + ndk-version: r25c + add-to-path: false + - name: Checkout MPC + uses: actions/checkout@v3 + with: + repository: DOCGroup/MPC + path: MPC + - name: Checkout ACE/TAO + uses: actions/checkout@v3 + with: + repository: DOCGroup/ACE_TAO + path: OpenDDS/build/ACE_TAO + - name: Install xerces + run: sudo apt-get -y install libxerces-c-dev + - name: Configure Host Tools + run: | + cd OpenDDS + cmake -B build-host \ + -G Ninja \ + -DBUILD_SHARED_LIBS=FALSE \ + -DOPENDDS_JUST_BUILD_HOST_TOOLS=TRUE + - name: Configure + run: | + cd OpenDDS + cmake -B build-host \ + -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) + - uses: ammaraskar/gcc-problem-matcher@0.2.0 + - name: Build Host Tools + run: | + cd OpenDDS + cmake --build build-host + - name: Build + run: | + cd OpenDDS + cmake --build build-target diff --git a/CMakeLists.txt b/CMakeLists.txt index e6bd2966600..56db33db5b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(OPENDDS_IS_BEING_BUILT TRUE CACHE INTERNAL "") set(OPENDDS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "") if(EXISTS "${OPENDDS_SOURCE_DIR}/dds/DdsDcpsC.h") message(FATAL_ERROR "It looks like OpenDDS was already built here using MPC. This could cause " - "issues with a CMake build. Please clean this source tree or use a seperate one.") + "issues with a CMake build. Please clean this source tree or use a separate one.") endif() set(OPENDDS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") get_filename_component(_OPENDDS_SOURCE_DIR_REAL "${OPENDDS_SOURCE_DIR}" REALPATH) @@ -124,12 +124,14 @@ if(OPENDDS_BUILD_EXAMPLES OR OPENDDS_BUILD_TESTS) endif() if(OPENDDS_BUILD_TESTS) add_subdirectory(tests/cmake/ace_tao_only) - add_subdirectory(tests/cmake/Messenger) + if(OPENDDS_OWNERSHIP_PROFILE) + add_subdirectory(tests/cmake/Messenger) + endif() add_subdirectory(tests/cmake/idl_compiler_tests) add_subdirectory(tests/cmake/include_subdir) # TODO: This shouldn't matter, but linker complains about ACE/TAO libs # lacking -fPIC. - if(NOT OPENDDS_STATIC) + if(OPENDDS_OWNERSHIP_PROFILE AND NOT OPENDDS_STATIC) add_subdirectory(tests/cmake/generated_global) endif() endif() diff --git a/cmake/configure_ace_tao.pl b/cmake/configure_ace_tao.pl index 104da027d78..0add2d4e216 100755 --- a/cmake/configure_ace_tao.pl +++ b/cmake/configure_ace_tao.pl @@ -88,8 +88,8 @@ sub read_file { "#define ACE_LACKS_READDIR_R\n" . "#define ACE_LACKS_TEMPNAM\n" . "#include \"$values{'config-file'}\"\n"; -# Always writing the config.h file will cause rebuilds, so don't it unless we -# actually need to change it. +# Always writing the config.h file will cause rebuilds, so don't do it unless +# we actually need to change it. if (!-f $config_path || read_file($config_path) ne $config_file_should_be) { open(my $config_file, '>', $config_path) or die("Failed to open $config_path: $!"); print $config_file ($config_file_should_be); diff --git a/cmake/import_common.cmake b/cmake/import_common.cmake index 7c80feea317..e343dde5bd5 100644 --- a/cmake/import_common.cmake +++ b/cmake/import_common.cmake @@ -247,7 +247,7 @@ function(_opendds_find_executables group exes) endif() set(mpc_projects_var "${group_prefix}_MPC_PROJECTS") - if(DEFINED "${mpc_projects_var}") + if(DEFINED "${mpc_projects_var}" AND NOT ${var}_HOST_TOOL) _opendds_find_in_mpc_projects( "${found_var}" "${var}" "${${mpc_projects_var}}" "${${var}_MPC_NAME}") if(${${found_var}}) diff --git a/dds/CMakeLists.txt b/dds/CMakeLists.txt index 010efe1cf9e..17e2b9e4c1f 100644 --- a/dds/CMakeLists.txt +++ b/dds/CMakeLists.txt @@ -506,7 +506,6 @@ target_sources(OpenDDS_Dcps DCPS/transport/framework/TransportImpl.inl DCPS/transport/framework/TransportImpl_rch.h DCPS/transport/framework/TransportInst.h - DCPS/transport/framework/TransportInst.inl DCPS/transport/framework/TransportInst_rch.h DCPS/transport/framework/TransportQueueElement.h DCPS/transport/framework/TransportQueueElement.inl