Workaround file-too-big error on MinGW CI

This commit is contained in:
Alexander Grund 2025-06-09 14:17:35 +02:00
parent 2f02e9c870
commit 68e66eefb4
2 changed files with 16 additions and 5 deletions

View file

@ -197,6 +197,9 @@ jobs:
if [[ -n "${{matrix.generator}}" ]]; then if [[ -n "${{matrix.generator}}" ]]; then
extra_args+=(-G "${{matrix.generator}}") extra_args+=(-G "${{matrix.generator}}")
fi fi
if [[ "${{matrix.generator}}" == "MinGW"* ]]; then
extra_args+=(-DCMAKE_CXX_FLAGS="-Wa,-mbig-obj")
fi
echo "Using extra args: ${extra_args[*]}" echo "Using extra args: ${extra_args[*]}"
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" "${extra_args[@]}" -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON cmake .. -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT="$BOOST_ROOT/stage" -DCMAKE_CXX_STANDARD="${CXX_STANDARD##*,}" "${extra_args[@]}" -DCMAKE_VERBOSE_MAKEFILE=ON -DBoost_DEBUG=ON -DBoost_VERBOSE=ON
cmake --build . --config Debug --parallel 3 cmake --build . --config Debug --parallel 3

View file

@ -19,16 +19,24 @@ path-constant parent : .. ;
run /boost/tools/inspect//inspect/<variant>release : $(parent) -text -brief : : <test-info>always_show_run_output : inspect ; run /boost/tools/inspect//inspect/<variant>release : $(parent) -text -brief : : <test-info>always_show_run_output : inspect ;
explicit inspect ; explicit inspect ;
rule run-test ( name ) rule run-test ( name : options * )
{ {
run $(name) defined_1.cpp defined_2.cpp undefined.cpp /boost//unit_test_framework : : : : $(name)_ ; run $(name) defined_1.cpp defined_2.cpp undefined.cpp /boost//unit_test_framework : : : $(options) : $(name)_ ;
run $(name) undefined.cpp /boost//unit_test_framework : : : <define>MOCK_USE_CONVERSIONS : $(name)_use_conversions ; run $(name) undefined.cpp /boost//unit_test_framework : : : $(options) <define>MOCK_USE_CONVERSIONS : $(name)_use_conversions ;
run $(name) undefined.cpp /boost//unit_test_framework /boost//thread : : : <define>MOCK_THREAD_SAFE <define>BOOST_THREAD_USES_MOVE <threading>multi : $(name)_thread_safe ; run $(name) undefined.cpp /boost//unit_test_framework /boost//thread : : : $(options) <define>MOCK_THREAD_SAFE <define>BOOST_THREAD_USES_MOVE <threading>multi : $(name)_thread_safe ;
} }
rule run-tests rule run-tests
{ {
for name in [ glob test_*.cpp detail/test_*.cpp ] { run-test $(name) ; } for name in [ glob test_*.cpp ] { run-test $(name) ; }
# Avoid object file getting to big on MinGW
run-test detail/test_function.cpp :
<toolset>gcc,<target-os>windows:<inlining>on
<toolset>gcc,<target-os>windows:<optimization>space ;
run-test detail/test_invocation.cpp ;
run-test detail/test_is_functor.cpp ;
run-test detail/test_signature.cpp ;
run-test detail/test_type_name.cpp ;
} }
alias mock_tests : [ run-tests ] ; alias mock_tests : [ run-tests ] ;