From 9e7bc922920557ed30db62414d7df556a4195e8d Mon Sep 17 00:00:00 2001 From: "Alastair F. Donaldson" Date: Wed, 12 Oct 2022 12:37:55 +0100 Subject: [PATCH] Fixes. --- .github/workflows/c_apps.sh | 10 +++++----- .github/workflows/cxx_apps.sh | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/c_apps.sh b/.github/workflows/c_apps.sh index c02979b5..ee8284ed 100755 --- a/.github/workflows/c_apps.sh +++ b/.github/workflows/c_apps.sh @@ -96,9 +96,9 @@ esac mkdir -p build pushd build - cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${CONFIG} "${CMAKE_OPTIONS[@]}" - cmake --build . --config ${CONFIG} - cmake -DCMAKE_INSTALL_PREFIX=./install -DBUILD_TYPE=${CONFIG} -P cmake_install.cmake + cmake -G Ninja .. -DCMAKE_BUILD_TYPE="${CONFIG}" "${CMAKE_OPTIONS[@]}" + cmake --build . --config "${CONFIG}" + cmake -DCMAKE_INSTALL_PREFIX=./install -DBUILD_TYPE="${CONFIG}" -P cmake_install.cmake popd # Check that dredd works on some projects @@ -107,7 +107,6 @@ cp "${DREDD_ROOT}/build/src/dredd/dredd" "${DREDD_EXECUTABLE}" case "$(uname)" in "Linux"|"MINGW"*|"MSYS_NT"*) - ;; echo "Curl" date @@ -129,7 +128,8 @@ case "$(uname)" in ninja # TODO: run some tests popd -popd + popd + ;; *) ;; diff --git a/.github/workflows/cxx_apps.sh b/.github/workflows/cxx_apps.sh index bf839754..004ababc 100755 --- a/.github/workflows/cxx_apps.sh +++ b/.github/workflows/cxx_apps.sh @@ -96,9 +96,9 @@ esac mkdir -p build pushd build - cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${CONFIG} "${CMAKE_OPTIONS[@]}" - cmake --build . --config ${CONFIG} - cmake -DCMAKE_INSTALL_PREFIX=./install -DBUILD_TYPE=${CONFIG} -P cmake_install.cmake + cmake -G Ninja .. -DCMAKE_BUILD_TYPE="${CONFIG}" "${CMAKE_OPTIONS[@]}" + cmake --build . --config "${CONFIG}" + cmake -DCMAKE_INSTALL_PREFIX=./install -DBUILD_TYPE="${CONFIG}" -P cmake_install.cmake popd # Check that dredd works on some projects @@ -112,6 +112,24 @@ ${DREDD_EXECUTABLE} --mutation-info-file temp.json examples/simple/pi.cc clang++ examples/simple/pi.cc -o examples/simple/pi diff --strip-trailing-cr <(./examples/simple/pi) <(echo "3.14159") +case "$(uname)" in +"MINGW"*|"MSYS_NT"*) + # Dredd can lead to object files with many sections, which can be too much for MSVC's default settings. + # This switch enables a larger number of sections. + CXXFLAGS="/bigobj" + export CXXFLAGS + ;; + +"Darwin") + # The Apple compiler does not use C++11 by default; Dredd requires at least this language version. + CXXFLAGS="-std=c++11" + export CXXFLAGS + ;; + +*) + ;; +esac + echo "examples/math: check that the tests pass after mutating the library" date