diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 5c7b408f5cc..ecd56457720 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -109,7 +109,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -171,7 +171,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --no-inline --tests --java=$JAVA_HOME_17_X64 --no-rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --no-inline --tests --java=$JAVA_HOME_17_X64 --no-rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -364,7 +364,8 @@ jobs: --optimize \ --no-debug \ --features=versioned_namespace=1 \ - --tests + --tests \ + --compile-warnings=WARNING - uses: ammaraskar/gcc-problem-matcher@0.3.0 - name: make OpenDDS run: | @@ -573,7 +574,8 @@ jobs: --gtest=$GITHUB_WORKSPACE/OpenDDS/tests/googletest/build/install \ --no-rapidjson \ --safety-profile \ - --tests + --tests \ + --compile-warnings=WARNING - name: exclude OpenDDS_Util and opendds_idl if: steps.cache-artifact.outputs.cache-hit != 'true' shell: bash @@ -653,7 +655,8 @@ jobs: --gtest=$GITHUB_WORKSPACE/OpenDDS/tests/googletest/build/install \ --no-rapidjson \ --safety-profile \ - --tests + --tests \ + --compile-warnings=WARNING - name: download ACE_TAO artifact uses: actions/download-artifact@v4 with: @@ -897,7 +900,8 @@ jobs: --no-rapidjson \ --safety-profile=base \ --no-built-in-topics \ - --tests + --tests \ + --compile-warnings=WARNING - name: exclude OpenDDS_Util and opendds_idl if: steps.cache-artifact.outputs.cache-hit != 'true' shell: bash @@ -978,7 +982,8 @@ jobs: --no-rapidjson \ --safety-profile=base \ --no-built-in-topics \ - --tests + --tests \ + --compile-warnings=WARNING - name: download ACE_TAO artifact uses: actions/download-artifact@v4 with: @@ -1207,7 +1212,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --no-debug --no-inline --features=versioned_namespace=1 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --no-debug --no-inline --features=versioned_namespace=1 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -1271,7 +1276,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --no-debug --no-inline --features=versioned_namespace=1 --tests --security --no-rapidjson --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --no-debug --no-inline --features=versioned_namespace=1 --tests --security --no-rapidjson --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -1494,7 +1499,8 @@ jobs: --features=uses_wchar=1 \ --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --tests \ - --security + --security \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -1570,7 +1576,8 @@ jobs: --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --tests \ --security \ - --rapidjson + --rapidjson \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -1795,7 +1802,8 @@ jobs: --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --tests \ --security \ - --no-rapidjson + --no-rapidjson \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -1870,7 +1878,8 @@ jobs: --tests \ --security \ --no-rapidjson \ - --features no_opendds_testing_features=0 + --features no_opendds_testing_features=0 \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -2095,7 +2104,8 @@ jobs: --std=c++03 \ --tests \ --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE \ - --mpc=$GITHUB_WORKSPACE/MPC + --mpc=$GITHUB_WORKSPACE/MPC \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -2170,7 +2180,8 @@ jobs: --tests \ --rapidjson \ --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE \ - --mpc=$GITHUB_WORKSPACE/MPC + --mpc=$GITHUB_WORKSPACE/MPC \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -2390,7 +2401,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --compiler=g++-8 --no-inline --no-rapidjson --tests --java --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --compiler=g++-8 --no-inline --no-rapidjson --tests --java --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -2459,7 +2470,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --compiler=g++-8 --no-inline --no-rapidjson --tests --java --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --compiler=g++-8 --no-inline --no-rapidjson --tests --java --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -2671,7 +2682,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -2736,7 +2747,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -2970,7 +2981,8 @@ jobs: --no-content-subscription \ --no-object-model-profile \ --no-persistence-profile \ - --tests + --tests \ + --compile-warnings=WARNING - name: exclude OpenDDS_Util and opendds_idl if: steps.cache-artifact.outputs.cache-hit != 'true' shell: bash @@ -3055,7 +3067,8 @@ jobs: --no-content-subscription \ --no-object-model-profile \ --no-persistence-profile \ - --tests + --tests \ + --compile-warnings=WARNING - name: download ACE_TAO artifact uses: actions/download-artifact@v4 with: @@ -3160,7 +3173,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -3225,7 +3238,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --qt --wireshark --tests --security --java --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --qt --wireshark --tests --security --java --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -3464,7 +3477,8 @@ jobs: --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --ipv6 \ --tests \ - --security + --security \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -3541,7 +3555,8 @@ jobs: --ipv6 \ --tests \ --security \ - --rapidjson + --rapidjson \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -3766,7 +3781,8 @@ jobs: --sanitize tsan \ --ipv6 \ --tests \ - --security + --security \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -3841,7 +3857,8 @@ jobs: --ipv6 \ --tests \ --security \ - --rapidjson + --rapidjson \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -4061,7 +4078,8 @@ jobs: --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --ipv6 \ --tests \ - --security + --security \ + --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -4139,7 +4157,8 @@ jobs: --macros=SOFLAGS+=-Wl,-h,\$\(SONAME\) \ --ipv6 \ --security \ - --rapidjson + --rapidjson \ + --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -4372,7 +4391,7 @@ jobs: run: | SSL_DIR=$PWD/openssl_install cd OpenDDS - ./configure --ipv6 --tests --security --openssl=$SSL_DIR --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --ipv6 --tests --security --openssl=$SSL_DIR --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -4449,7 +4468,7 @@ jobs: SSL_DIR=$PWD/openssl_install export SSL_LIBDIR=$SSL_DIR/lib64 cd OpenDDS - ./configure --ipv6 --tests --security --openssl=$SSL_DIR --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --ipv6 --tests --security --openssl=$SSL_DIR --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING echo "export SSL_LIBDIR=$SSL_LIBDIR" >> setenv.sh - name: check build configuration shell: bash @@ -4803,7 +4822,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --tests --java=$JAVA_HOME_8_X64 --no-built-in-topics --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --tests --java=$JAVA_HOME_8_X64 --no-built-in-topics --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -5039,7 +5058,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --features=uses_wchar=1 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --features=uses_wchar=1 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -5103,7 +5122,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --features=uses_wchar=1 --features dds_suppress_anys=0 --tests --security --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --features=uses_wchar=1 --features dds_suppress_anys=0 --tests --security --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -5309,7 +5328,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --features=uses_wchar=1 --tests --java --no-content-subscription --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --features=uses_wchar=1 --tests --java --no-content-subscription --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -5538,7 +5557,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --static --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --static --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -5614,7 +5633,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --static --qt --wireshark --security --rapidjson --gtest=$GITHUB_WORKSPACE/OpenDDS/tests/googletest/build/install --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --static --qt --wireshark --security --rapidjson --gtest=$GITHUB_WORKSPACE/OpenDDS/tests/googletest/build/install --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -6490,7 +6509,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -6554,7 +6573,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --tests --java --no-content-filtered-topic --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --tests --java --no-content-filtered-topic --rapidjson --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -6795,7 +6814,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --ipv6 --static --no-rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy + configure --ipv6 --static --no-rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy --compile-warnings=WARNING - name: build ACE & TAO if: steps.cache-artifact.outputs.cache-hit != 'true' shell: cmd @@ -6882,7 +6901,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --ipv6 --static --no-rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows + configure --ipv6 --static --no-rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -7781,7 +7800,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --ipv6 --static --rapidjson --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy + configure --ipv6 --static --rapidjson --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy --compile-warnings=WARNING - name: build ACE & TAO if: steps.cache-artifact.outputs.cache-hit != 'true' shell: cmd @@ -7868,7 +7887,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --ipv6 --static --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows + configure --ipv6 --static --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --no-built-in-topics --no-content-subscription --no-ownership-profile --no-object-model-profile --no-persistence-profile --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -8776,7 +8795,7 @@ jobs: run: | set SSL_DIR=%CD%/openssl3 cd OpenDDS - call configure -v --optimize --ipv6 --security --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=%SSL_DIR% --mpcopts=-hierarchy + call configure -v --optimize --ipv6 --security --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=%SSL_DIR% --mpcopts=-hierarchy --compile-warnings=WARNING echo "SSL_DIR=%SSL_DIR%" >> setenv.cmd perl tools\scripts\show_build_config.pl - name: build ACE & TAO @@ -8875,7 +8894,7 @@ jobs: run: | set SSL_DIR=%CD%/openssl3 cd OpenDDS - configure --optimize --ipv6 --rapidjson --security --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=%SSL_DIR% + configure --optimize --ipv6 --rapidjson --security --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=%SSL_DIR% --compile-warnings=WARNING echo "SSL_DIR=%SSL_DIR%" >> setenv.cmd - name: check build configuration shell: cmd @@ -9732,7 +9751,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --optimize --java --no-built-in-topics --rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy + configure --optimize --java --no-built-in-topics --rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy --compile-warnings=WARNING - name: build ACE & TAO if: steps.cache-artifact.outputs.cache-hit != 'true' shell: cmd @@ -9828,7 +9847,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --optimize --java --no-built-in-topics --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --wireshark-cmake=${{ github.workspace }}\wireshark --wireshark-build=${{ github.workspace }}\wsbuild --wireshark-lib=run --glib=${{ github.workspace }}\wireshark-win64-libs-3.6\vcpkg-export-20210609-1-win64ws\installed\x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy + configure --optimize --java --no-built-in-topics --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --wireshark-cmake=${{ github.workspace }}\wireshark --wireshark-build=${{ github.workspace }}\wsbuild --wireshark-lib=run --glib=${{ github.workspace }}\wireshark-win64-libs-3.6\vcpkg-export-20210609-1-win64ws\installed\x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -10563,7 +10582,7 @@ jobs: shell: cmd run: | cd OpenDDS - call configure -v --no-inline --tests --security --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x86-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x86-windows --mpcopts=-hierarchy + call configure -v --no-inline --tests --security --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x86-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x86-windows --mpcopts=-hierarchy --compile-warnings=WARNING perl tools\scripts\show_build_config.pl - name: build ACE & TAO if: steps.cache-artifact.outputs.cache-hit != 'true' @@ -10652,7 +10671,7 @@ jobs: shell: cmd run: | cd /d C:\OpenDDS - configure --tests --rapidjson --security --ace=${{ github.workspace }}\ACE_TAO\ACE --tao=${{ github.workspace }}\ACE_TAO\TAO --mpc=${{ github.workspace }}\MPC --xerces3="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" --openssl="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" + configure --tests --rapidjson --security --ace=${{ github.workspace }}\ACE_TAO\ACE --tao=${{ github.workspace }}\ACE_TAO\TAO --mpc=${{ github.workspace }}\MPC --xerces3="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" --openssl="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -11037,7 +11056,7 @@ jobs: shell: cmd run: | cd /d C:\OpenDDS - configure --tests --java --no-built-in-topics --rapidjson --mpc=${{ github.workspace }}\MPC --xerces3="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" --features no_opendds_testing_features=0 + configure --tests --java --no-built-in-topics --rapidjson --mpc=${{ github.workspace }}\MPC --xerces3="${{ env.VCPKG_INSTALLED_DIR }}\x86-windows" --features no_opendds_testing_features=0 --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -11273,7 +11292,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --std=c++20 --tests --ipv6 --rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy + configure --std=c++20 --tests --ipv6 --rapidjson --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --mpcopts=-hierarchy --compile-warnings=WARNING - name: build ACE & TAO if: steps.cache-artifact.outputs.cache-hit != 'true' shell: cmd @@ -11360,7 +11379,7 @@ jobs: shell: cmd run: | cd OpenDDS - configure --std=c++20 --ipv6 --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows + configure --std=c++20 --ipv6 --rapidjson --gtest=${{ github.workspace }}/OpenDDS/tests/googletest/build/install --ace=${{ github.workspace }}/OpenDDS/ACE_TAO/ACE --tao=${{ github.workspace }}/OpenDDS/ACE_TAO/TAO --mpc=${{ github.workspace }}/MPC --xerces3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --openssl=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows --compile-warnings=WARNING - name: check build configuration shell: cmd run: | @@ -12076,7 +12095,7 @@ jobs: run: | cd OpenDDS XERCESC_ROOT=$(find /usr/local/Cellar/xerces-c -iname "3\.*\.*" -type d | sort -r | head -n 1) - ./configure --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 + ./configure --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -12142,7 +12161,7 @@ jobs: run: | cd OpenDDS XERCESC_ROOT=$(find /usr/local/Cellar/xerces-c -iname "3\.*\.*" -type d | sort -r | head -n 1) - ./configure --std=c++11 --tests --rapidjson --security --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 + ./configure --std=c++11 --tests --rapidjson --security --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -12455,7 +12474,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --std=c++11 --tests --rapidjson --java --no-built-in-topics --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --std=c++11 --tests --rapidjson --java --no-built-in-topics --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -12794,7 +12813,7 @@ jobs: run: | cd OpenDDS XERCESC_ROOT=$(find /usr/local/Cellar/xerces-c -iname "3\.*\.*" -type d | sort -r | head -n 1) - ./configure --optimize --no-debug --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 + ./configure --optimize --no-debug --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -12861,7 +12880,7 @@ jobs: cd OpenDDS clang++ --version XERCESC_ROOT=$(find /usr/local/Cellar/xerces-c -iname "3\.*\.*" -type d | sort -r | head -n 1) - ./configure --optimize --no-debug --std=c++11 --tests --rapidjson --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 + ./configure --optimize --no-debug --std=c++11 --tests --rapidjson --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -13195,7 +13214,7 @@ jobs: run: | cd OpenDDS XERCESC_ROOT=$(find /usr/local/Cellar/xerces-c -iname "3\.*\.*" -type d | sort -r | head -n 1) - ./configure --no-inline --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 + ./configure --no-inline --std=c++11 --tests --security --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --xerces3=$XERCESC_ROOT --openssl=/usr/local/opt/openssl@1.1 --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -13262,7 +13281,7 @@ jobs: run: | cd OpenDDS clang++ --version - ./configure --no-inline --std=c++11 --tests --rapidjson --java --no-built-in-topics --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC + ./configure --no-inline --std=c++11 --tests --rapidjson --java --no-built-in-topics --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d6e796b7682..d6956ecf446 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -90,6 +90,7 @@ jobs: -DBUILD_SHARED_LIBS=TRUE \ -DCMAKE_BUILD_TYPE=Debug \ -DOPENDDS_BOOTTIME_TIMERS=TRUE \ + -DOPENDDS_COMPILE_WARNINGS=WARNING \ -DOPENDDS_SECURITY=TRUE \ -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ @@ -132,6 +133,7 @@ jobs: -DCMAKE_UNITY_BUILD=TRUE \ -DBUILD_SHARED_LIBS=FALSE \ -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_COMPILE_WARNINGS=WARNING \ -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ -DOPENDDS_BUILD_TESTS=TRUE \ @@ -176,6 +178,7 @@ jobs: -DCMAKE_UNITY_BUILD=TRUE \ -DBUILD_SHARED_LIBS=TRUE \ -DCMAKE_BUILD_TYPE=Debug \ + -DOPENDDS_COMPILE_WARNINGS=WARNING \ -DOPENDDS_ACE_TAO_SRC=$GITHUB_WORKSPACE/OpenDDS/build/ACE_TAO \ -DOPENDDS_MPC=$GITHUB_WORKSPACE/MPC \ -DOPENDDS_BUILD_TESTS=TRUE \ @@ -228,6 +231,7 @@ jobs: cmake -B build-host \ -G Ninja \ -DBUILD_SHARED_LIBS=FALSE \ + -DOPENDDS_COMPILE_WARNINGS=WARNING \ -DOPENDDS_JUST_BUILD_HOST_TOOLS=TRUE - uses: ammaraskar/gcc-problem-matcher@0.3.0 - name: Build Host Tools @@ -242,6 +246,7 @@ jobs: -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_COMPILE_WARNINGS=WARNING \ -DOPENDDS_CMAKE_VERBOSE=all \ -DOPENDDS_HOST_TOOLS=$(realpath build-host) - name: Build Target @@ -287,6 +292,7 @@ jobs: cd OpenDDS cmake -B build^ -DBUILD_SHARED_LIBS=TRUE^ + -DOPENDDS_COMPILE_WARNINGS=WARNING^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ @@ -343,6 +349,7 @@ jobs: cmake -B build^ -DCMAKE_UNITY_BUILD=TRUE^ -DBUILD_SHARED_LIBS=FALSE^ + -DOPENDDS_COMPILE_WARNINGS=WARNING^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ @@ -400,6 +407,7 @@ jobs: cmake -B build^ -DCMAKE_UNITY_BUILD=TRUE^ -DBUILD_SHARED_LIBS=TRUE^ + -DOPENDDS_COMPILE_WARNINGS=WARNING^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ @@ -456,6 +464,7 @@ jobs: cmake -B build^ -DCMAKE_UNITY_BUILD=TRUE^ -DBUILD_SHARED_LIBS=FALSE^ + -DOPENDDS_COMPILE_WARNINGS=WARNING^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ diff --git a/build.ini b/build.ini new file mode 100644 index 00000000000..1343bf477d7 --- /dev/null +++ b/build.ini @@ -0,0 +1,15 @@ +[Clang] +warning=-Wall -Wpedantic -Wno-unused -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow=5 -Wundef +error=-Werror + +[AppleClang] +warning=-Wall -Wpedantic -Wno-unused -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow=5 -Wundef +error=-Werror + +[GNU] +warning=-Wall -Wpedantic -Wno-unused -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow=5 -Wundef +error=-Werror + +[MSVC] +warning=/W4 +error=/WX diff --git a/cmake/opendds_build_helpers.cmake b/cmake/opendds_build_helpers.cmake index 2faf4d9ee4a..40849cb1a42 100644 --- a/cmake/opendds_build_helpers.cmake +++ b/cmake/opendds_build_helpers.cmake @@ -5,7 +5,20 @@ set(_opendds_exec_perms GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -function(_opendds_alias target) +# Load in build settings. +file(STRINGS "${OPENDDS_SOURCE_DIR}/build.ini" build_ini) +unset(section) +foreach(line IN LISTS build_ini) + if(line MATCHES "^\\[(.*)\\]$") + set(section "${CMAKE_MATCH_1}") + elseif(section AND line MATCHES "^([^=#]+)=(.*)$") + set(name "${CMAKE_MATCH_1}") + set(value "${CMAKE_MATCH_2}") + set("${section}-${name}" "${value}") + endif() +endforeach() + +function(_opendds_target target) # This is the name the target should be exported from CMake-build OpenDDS as # or imported in the MPC-built OpenDDS CMake package. For consistency and # convenience, alias it so we can use it within the OpenDDS CMake build. @@ -18,6 +31,15 @@ function(_opendds_alias target) add_executable("${name}" ALIAS "${target}") endif() set_target_properties(${target} PROPERTIES EXPORT_NAME "${name}") + + if(OPENDDS_COMPILE_WARNINGS STREQUAL "WARNING" OR OPENDDS_COMPILE_WARNINGS STREQUAL "ERROR") + string(REPLACE " " ";" outvar ${${CMAKE_CXX_COMPILER_ID}-warning}) + target_compile_options(${target} PRIVATE ${outvar}) + if(OPENDDS_COMPILE_WARNINGS STREQUAL "ERROR") + string(REPLACE " " ";" outvar ${{CMAKE_CXX_COMPILER_ID}-error}) + target_compile_options(${target} PRIVATE ${outvar}) + endif() + endif() endfunction() function(_opendds_library target) @@ -27,7 +49,7 @@ function(_opendds_library target) cmake_parse_arguments(arg "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) - _opendds_alias(${target}) + _opendds_target(${target}) _opendds_cxx_std(${target} PUBLIC) target_link_libraries(${target} PUBLIC OpenDDS_Config) @@ -83,7 +105,7 @@ function(_opendds_executable target) cmake_parse_arguments(arg "${no_value_options}" "${single_value_options}" "${multi_value_options}" ${ARGN}) - _opendds_alias(${target}) + _opendds_target(${target}) _opendds_cxx_std(${target} PRIVATE) target_link_libraries(${target} PRIVATE OpenDDS_Config) set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OPENDDS_BIN_DIR}") diff --git a/configure b/configure index e44318e4839..fa7ce95af34 100755 --- a/configure +++ b/configure @@ -210,6 +210,9 @@ my @specs = # Array of array-refs, each inner array is an option group which $argIndent . ' asan: Address Sanitizer, gcc/clang only' . $argIndent . ' tsan: Thread Sanitizer, gcc/clang only' . $argIndent . ' ubsan: Undefined Behavior Sanitizer, clang only', + 'compile-warnings=s', 'Enable additional compiler warnings (empty)' . + $argIndent . 'If set to WARNING, enable additional warnings' . + $argIndent . 'If set to ERROR, enable additional warnings and treated them as errors', ], ['Required dependencies for OpenDDS:', 'ace=s', 'ACE (use ACE_ROOT, ACE_wrappers, or download)', @@ -788,6 +791,7 @@ EOF elsif ($opts{'compiler'} =~ /g\+\+|clang/) { my $version_string = `$opts{'compiler'} --version`; print "Compiler version: $version_string\n" if $opts{'verbose'}; + $opts{'is apple clang'} = $version_string =~ /^Apple/; if ($opts{'std'}) { push(@{$opts{'macros'}}, 'CCFLAGS += -std=' . $opts{'std'}); print "Added platform_macros for -std=$opts{std}\n" if $opts{'verbose'}; @@ -825,6 +829,21 @@ EOF } } +if ($opts{'compile-warnings'} eq 'WARNING' or $opts{'compile-warnings'} eq 'ERROR') { + my ($section_names, $sections) = read_ini_file("$FindBin::RealBin/build.ini"); + my %compiler_map = ( 'g++' => 'GNU', 'clang' => 'Clang', 'cl' => 'MSVC', 'cl.exe' => 'MSVC'); + my $section = $compiler_map{$opts{'compiler'}}; + if ($opts{'is apple clang'}) { + $section = 'AppleClang'; + } + my $warning_flags = $sections->{$section}{'warning'}; + my $error_flags = $sections->{$section}{'error'}; + push(@{$opts{'mpcopts'}}, '-value_template', "compile_flags+=${warning_flags}"); + if ($opts{'compile-warnings'} eq 'ERROR') { + push(@{$opts{'mpcopts'}}, '-value_template', "compile_flags+=${error_flags}"); + } +} + sub looksRelative { my $val = shift; return substr($val, 0, 1) ne $slash && ($slash eq '/' || $val !~ /^[a-z]:/i); diff --git a/docs/devguide/building/index.rst b/docs/devguide/building/index.rst index 544d199f345..caf04045057 100644 --- a/docs/devguide/building/index.rst +++ b/docs/devguide/building/index.rst @@ -682,6 +682,13 @@ These are all the variables that are exclusive to building OpenDDS with CMake: Enable this option to use CLOCK_BOOTTIME as the timer base clock instead of CLOCK_MONOTONIC. Default is ``OFF``. +.. cmake:var:: OPENDDS_COMPILE_WARNINGS + + If set to ``WARNING``, enables additional compiler warnings when compiling OpenDDS. + If set to ``ERROR``, enables additional compiler warnings which are treated as errors when compiling OpenDDS. + + .. versionadded:: 3.28 + Speeding up the build --------------------- diff --git a/docs/news.d/compiler-warnings.rst b/docs/news.d/compiler-warnings.rst new file mode 100644 index 00000000000..b5bac1d3f26 --- /dev/null +++ b/docs/news.d/compiler-warnings.rst @@ -0,0 +1,5 @@ +.. news-prs: 4558 + +.. news-start-section: Additions +- Added :cmake:var:`OPENDDS_COMPILE_WARNINGS` and ``configure`` option ``--compile-warnings=[WARNING|ERROR]`` to enable additional compiler warnings and treating them as errors. +.. news-end-section