Skip to content

Commit

Permalink
Fixed LTO builds failing due to incorrect flags.
Browse files Browse the repository at this point in the history
Original configuration would add `-D-flto -D-flto-report` to CFLAGS when building sclang, resulting in compilation failing.
  • Loading branch information
laserbat committed May 18, 2021
1 parent 3574958 commit 15f5b00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lang/CMakeLists.txt
Expand Up @@ -339,10 +339,14 @@ target_link_libraries(sclang ${ICU_LIBRARIES})
target_compile_definitions(sclang PUBLIC USE_SC_TERMINAL_CLIENT)

if(LTO)
target_compile_definitions(libsclang PUBLIC -flto -flto-report)

set_property(TARGET sclang libsclang
APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")

set_property(TARGET sclang
APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")

set_property(TARGET libsclang
APPEND PROPERTY LINK_FLAGS "-flto -flto-report")
endif()

if(APPLE)
Expand Down

0 comments on commit 15f5b00

Please sign in to comment.