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 54b3aad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/libdnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ else ()
endif ()
include(ExternalProject)
set(LIBDNET_SRC ${CMAKE_BINARY_DIR}/libdnet)
if (APPLE)
if (DEFINED CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
#list(JOIN CMAKE_OSX_ARCHITECTURES ";" DNET_ARCHS)
string(REPLACE " " ";" 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 54b3aad

Please sign in to comment.