Skip to content

Commit

Permalink
Fix CI build error
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed May 26, 2024
1 parent 7bd88da commit a7f913d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ else ()
list(FIND ZIG_BE "${ZIG_TARGET_ARCH}" INDEX)
if (${INDEX} GREATER -1)
message(STATUS "Patching Layer.h to support big endian when cross-compiling")
add_custom_command(
OUTPUT ${PcapPlusPlus_SOURCE_DIR}/Packet++/header/Layer.h
add_custom_target(PatchLayer
WORKING_DIRECTORY ${PcapPlusPlus_SOURCE_DIR}
COMMAND patch -Np1 -i ${CMAKE_SOURCE_DIR}/endian.patch || true
DEPENDS ${CMAKE_SOURCE_DIR}/endian.patch
COMMAND git checkout -- ${PcapPlusPlus_SOURCE_DIR}/Packet++/header/Layer.h
COMMAND git apply --stat --apply ${CMAKE_SOURCE_DIR}/endian.patch
)
add_custom_target(PatchLayer ALL DEPENDS ${PcapPlusPlus_SOURCE_DIR}/Packet++/header/Layer.h)
add_dependencies(Pcap++ PatchLayer)
add_dependencies(Packet++ PatchLayer)
endif ()
endif ()

Expand Down

0 comments on commit a7f913d

Please sign in to comment.