Skip to content

Commit

Permalink
Make libdnet build architecture aware on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nohal committed Aug 19, 2024
1 parent 984c6a2 commit 56472c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/libdnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ else ()
endif ()
include(ExternalProject)
set(LIBDNET_SRC ${CMAKE_BINARY_DIR}/libdnet)
if (APPLE)
if (DEFINED CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
string(REPLACE ";" "$<SEMICOLON>" DNET_ARCHS "${CMAKE_OSX_ARCHITECTURES}")
set(CMAKE_ADDITIONAL_PARAMS "-DCMAKE_OSX_ARCHITECTURES='${DNET_ARCHS}'")
endif ()
endif ()
ExternalProject_Add(
libdnet

GIT_REPOSITORY "https://github.com/ofalk/libdnet.git"
GIT_TAG "libdnet-1.18.0"

UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=/lib -DCMAKE_INSTALL_INCLUDEDIR=/include
CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=/lib -DCMAKE_INSTALL_INCLUDEDIR=/include ${CMAKE_ADDITIONAL_PARAMS}
SOURCE_DIR "${LIBDNET_SRC}"
TEST_COMMAND ""
INSTALL_COMMAND make DESTDIR=${LIBDNET_SRC}/installed install
Expand Down

0 comments on commit 56472c2

Please sign in to comment.