Skip to content

Commit

Permalink
Fix cmake build for latest gcc
Browse files Browse the repository at this point in the history
libraries link order is relevant on latest gcc
  • Loading branch information
xliang-lifesize authored and albfan committed Jan 4, 2023
1 parent a36e9bd commit 3018aac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dhcp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ add_executable(miracle-dhcp ${miracle-dhcp_SRCS})
find_package(PkgConfig)
pkg_check_modules (GLIB2 REQUIRED glib-2.0)
pkg_check_modules (UDEV REQUIRED libudev)
target_link_libraries(miracle-dhcp miracle-shared)
link_directories( ${UDEV_LIBRARY_DIRS})
include_directories( ${UDEV_INCLUDE_DIRS})
target_link_libraries(miracle-dhcp ${UDEV_LIBRARIES})
Expand All @@ -21,7 +22,6 @@ link_directories( ${GLIB2_LIBRARY_DIRS})
include_directories( ${GLIB2_INCLUDE_DIRS})
target_link_libraries(miracle-dhcp ${GLIB2_LIBRARIES})

target_link_libraries(miracle-dhcp miracle-shared)

install(TARGETS miracle-dhcp DESTINATION bin)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/shared)

0 comments on commit 3018aac

Please sign in to comment.