McMartin / FRUT

Building JUCE projects using CMake made easy
https://frut.readthedocs.io
GNU General Public License v3.0
431 stars 40 forks source link

IconBuilder compilation on MSVC 16.10.0 requires the /bigobj flag #684

Closed steve-baker-cradle closed 3 years ago

steve-baker-cradle commented 3 years ago

When compiling on MSVC 16.10.0 I hit the following error:

Failed to build IconBuilder

Versions

CMake: 3.20.2 FRUT: commit 55f1c02cc836c08ec5469f64a3f8cc89ecb535fb JUCE: unknown (no juce_core module)

CMake variables

CMAKE_C_COMPILER: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe"
CMAKE_C_COMPILER_ID: "MSVC"
CMAKE_C_COMPILER_VERSION: "19.29.30037.0"
CMAKE_CXX_COMPILER: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe"
CMAKE_CXX_COMPILER_ID: "MSVC"
CMAKE_CXX_COMPILER_VERSION: "19.29.30037.0"
CMAKE_EXTRA_GENERATOR: ""
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_GENERATOR_PLATFORM: ""
CMAKE_GENERATOR_TOOLSET: ""
CMAKE_SYSTEM: "Windows-10.0.19042"

Variables from Reprojucer.cmake

JUCER_PROJECT_TYPE: "Audio Plug-in"
JUCER_VERSION: ""

Output of execute_process()

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/cradle-engine/cradle-engine/3rdparty/FRUT/cmake/tools/_build/Visual Studio 16 2019

Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  juce_core.cpp
  juce_data_structures.cpp
  juce_events.cpp
  juce_graphics.cpp
  juce_gui_basics.cpp
  Generating Code...
C:\dev\cradle-engine\cradle-engine\3rdparty\JUCE\modules\juce_gui_basics\juce_gui_basics.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj [C:\dev\cradle-engine\cradle-engine\3rdparty\FRUT\cmake\tools\_build\Visual Studio 16 2019\tools_juce_gui_basics.vcxproj]

Patching cmake\tools\juce_gui_basics.cmake to add:

if (MSVC)
  target_compile_options(tools_juce_gui_basics PUBLIC /bigobj)
endif()

seems to resolve the issue?

McMartin commented 3 years ago

@steve-baker-cradle thanks a lot for reporting this issue and for proposing a fix! I'll take care of fixing this as soon as possible.

steve-baker-cradle commented 3 years ago

Thanks @McMartin!