From 7a4191e16d1006ce33d51472ddc3fe7012b952a0 Mon Sep 17 00:00:00 2001 From: Ziemas Date: Sun, 24 Oct 2021 22:11:38 +0200 Subject: [PATCH] Fix compilation with LTO on GCC --- common/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3768cf73a8..f7342f52b1 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -170,6 +170,11 @@ else() endif() endif() +if (USE_GCC AND CMAKE_INTERPROCEDURAL_OPTIMIZATION) + # GCC LTO doesn't work with asm statements + set_source_files_properties(FastJmp.cpp PROPERTIES COMPILE_FLAGS -fno-lto) +endif() + target_link_libraries(common PRIVATE ${LIBC_LIBRARIES} PUBLIC wxWidgets::all glad) target_compile_features(common PUBLIC cxx_std_17) target_include_directories(common PUBLIC ../3rdparty/include ../)