Skip to content

Commit 1eb447d

Browse files
twilfredosteven-bellock
authored andcommitted
CMakeLists: arm: fixup lto option
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]>
1 parent 2756b67 commit 1eb447d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
322322
SET(FLTO_COMPILE_OPTS "-fno-lto")
323323
SET(FLTO_LINK_OPTS "-fno-lto")
324324
else()
325-
SET(FLTO_COMPILE_OPTS "-flto" "-${USING_LTO}")
325+
if (DEFINED USING_LTO)
326+
SET(FLTO_COMPILE_OPTS "-flto" "-${USING_LTO}")
327+
else()
328+
SET(FLTO_COMPILE_OPTS "-flto")
329+
endif()
326330
SET(FLTO_LINK_OPTS "-flto")
327331
endif()
328332
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

0 commit comments

Comments
 (0)