Skip to content

Commit

Permalink
CMakeLists: arm: fixup lto option
Browse files Browse the repository at this point in the history
This fixes an issue introduced in [1], we incorrectly append
the `USING_LTO` option even when it's not defined. This ensures we
check that it is defined first.

[1] #2457

Signed-off-by: Wilfred Mallawa <[email protected]>
  • Loading branch information
twilfredo authored and steven-bellock committed Dec 18, 2023
1 parent 2756b67 commit 1eb447d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(FLTO_COMPILE_OPTS "-fno-lto")
SET(FLTO_LINK_OPTS "-fno-lto")
else()
SET(FLTO_COMPILE_OPTS "-flto" "-${USING_LTO}")
if (DEFINED USING_LTO)
SET(FLTO_COMPILE_OPTS "-flto" "-${USING_LTO}")
else()
SET(FLTO_COMPILE_OPTS "-flto")
endif()
SET(FLTO_LINK_OPTS "-flto")
endif()
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
Expand Down

0 comments on commit 1eb447d

Please sign in to comment.