From 95b4c9b42d0c4d160b99745be55659cf54da34ed Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 21 Oct 2020 16:26:42 -0700 Subject: [PATCH] Pass -fkeep-inline-functions to gcc before version 8 Attempt to workaround gcc bug. Issue #37. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d8ead6..c64786c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") list (APPEND PBRT_CXX_FLAGS "-fp-model ${FP_MODEL}") endif () +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + list (APPEND PBRT_CXX_FLAGS -fkeep-inline-functions) +endif () + if (MSVC AND MSVC_VERSION LESS 1920) message (SEND_ERROR "pbrt-v4 currently requires MSVC 2019 to build on Windows. PRs that get MSVC 2017 working as well would be welcomed. :-)") endif () -- GitLab