Skip to content

Commit

Permalink
build(libnetlink): allow setting CMAKE_BUILD_TYPE
Browse files Browse the repository at this point in the history
Previously, libnetlink was harded to compile in DEBUG mode.
Now it should inherit EDGESec's compile mode.
  • Loading branch information
aloisklink committed Jun 10, 2022
1 parent a80509e commit dd916f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/libnetlink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ endif()
# libmnl0 linking doesn't work properly, unless we setup RPATHs
SET(CMAKE_INSTALL_RPATH "$ORIGIN" "$<TARGET_LINKER_FILE_DIR:MNL::mnl>")

set(CMAKE_BUILD_TYPE Debug)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LIBMNL")
Expand Down

0 comments on commit dd916f9

Please sign in to comment.