Skip to content

Commit

Permalink
add no-lto flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Nov 2, 2022
1 parent f2f587a commit b80361a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/fw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ set(L53X_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/L5xx/FW")

add_library(${PROJECT_NAME} STATIC empty.c)

# disable link time optimization for fw by adding -fno-lto to disable -flto flag
# jammy debian has build errors without it
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "disable link time optimization for fw project")
target_compile_options(${PROJECT_NAME} PRIVATE -fno-lto)
endif()

if (MSVC)
# lib.exe can't handle multiple .res files, so include them in one.
# even then, the linker won't grab a .res out of a .lib object, so it needs to be explicitly listed
Expand Down

0 comments on commit b80361a

Please sign in to comment.