Adding fix for mingw32 compiling on windows

This commit is contained in:
Peter M. Clausen 2021-05-25 09:25:56 +02:00
parent efb82954a7
commit 6a004c800a

View File

@ -32,6 +32,11 @@ target_include_directories(approvaltests
INTERFACE ${catch2_SOURCE_DIR}/single_include/catch2 INTERFACE ${catch2_SOURCE_DIR}/single_include/catch2
) )
if( MINGW )
# https://stackoverflow.com/questions/31890021/mingw-too-many-sections-bug-while-compiling-huge-header-file-in-qt
set (CMAKE_CXX_FLAGS "-Wa,-mbig-obj ")
endif()
add_executable(gildedrose_catch2 add_executable(gildedrose_catch2
src/GildedRose.h src/GildedRose.h
src/GildedRose.cc src/GildedRose.cc
@ -42,6 +47,8 @@ target_include_directories(gildedrose_catch2
PUBLIC src) PUBLIC src)
target_link_libraries(gildedrose_catch2 Catch2::Catch2 approvaltests) target_link_libraries(gildedrose_catch2 Catch2::Catch2 approvaltests)
include(CTest) include(CTest)
include(ParseAndAddCatchTests) include(ParseAndAddCatchTests)
ParseAndAddCatchTests(gildedrose_catch2) ParseAndAddCatchTests(gildedrose_catch2)