Skip to content

Commit

Permalink
Format cmake files for line length.
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Lawrence <[email protected]>
  • Loading branch information
shane-lawrence committed Dec 23, 2024
1 parent 5cfebad commit 09418cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 9 additions & 3 deletions cmake/modules/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -fno-strict-aliasing -DNDEBUG -g")

# Add linker flags to generate separate debug files
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id"
)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -Wl,--build-id"
)

else() # MSVC
set(MINIMAL_BUILD ON)
Expand All @@ -113,7 +117,9 @@ else() # MSVC

# Ensure linker generates PDB files for MSVC
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG"
)

set(CMAKE_C_FLAGS "${FALCOSECURITY_LIBS_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "${FALCOSECURITY_LIBS_COMMON_FLAGS}")
Expand Down
10 changes: 7 additions & 3 deletions userspace/falco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,14 @@ endif()
if(CMAKE_BUILD_TYPE STREQUAL "relwithdebinfo" AND NOT WIN32)
find_program(OBJCOPY_EXECUTABLE NAMES objcopy)
if(OBJCOPY_EXECUTABLE)
add_custom_command(TARGET falco POST_BUILD
COMMAND ${OBJCOPY_EXECUTABLE} --only-keep-debug $<TARGET_FILE:falco> $<TARGET_FILE:falco>.debug
add_custom_command(
TARGET falco
POST_BUILD
COMMAND ${OBJCOPY_EXECUTABLE} --only-keep-debug $<TARGET_FILE:falco>
$<TARGET_FILE:falco>.debug
COMMAND ${OBJCOPY_EXECUTABLE} --strip-debug --strip-unneeded $<TARGET_FILE:falco>
COMMAND ${OBJCOPY_EXECUTABLE} --add-gnu-debuglink=$<TARGET_FILE:falco>.debug $<TARGET_FILE:falco>
COMMAND ${OBJCOPY_EXECUTABLE} --add-gnu-debuglink=$<TARGET_FILE:falco>.debug
$<TARGET_FILE:falco>
COMMENT "Generating separate debug file for falco"
)
else()
Expand Down

0 comments on commit 09418cb

Please sign in to comment.