Skip to content

Commit

Permalink
Disables LTO for mason+gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-j-h committed Mar 1, 2017
1 parent 07221f5 commit 04a95c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ if(ENABLE_GOLD_LINKER)
endif()
endif()

# Disable LTO when mason+gcc is detected before testing for / setting any flags.
# Mason builds libraries with Clang, mixing does not work in the context of lto.
if(ENABLE_MASON AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(ENABLE_LTO Off)
message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
endif()

# Explicitly set the build type to Release if no other type is specified
# on the command line. Without this, cmake defaults to an unoptimized,
# non-debug build, which almost nobody wants.
Expand Down

0 comments on commit 04a95c1

Please sign in to comment.