File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,9 +80,18 @@ execute_process(
8080 OUTPUT_VARIABLE TARGET_MULTIARCH
8181 OUTPUT_STRIP_TRAILING_WHITESPACE
8282 RESULT_VARIABLE TARGET_MULTIARCH_RESULT
83+ ERROR_QUIET
8384)
84- if (NOT TARGET_MULTIARCH_RESULT EQUAL 0 OR NOT TARGET_MULTIARCH)
85- message (FATAL_ERROR "Failed to determine the target multiarch tuple" )
85+ # Debian-based toolchains use a multiarch include directory. Native RPM-based
86+ # toolchains may return an empty tuple and use /usr/include directly instead.
87+ # Keep this nonempty because the eBPF compile command passes it to -isystem.
88+ set (TARGET_MULTIARCH_INCLUDE "/usr/include" )
89+ if (TARGET_MULTIARCH_RESULT EQUAL 0 AND TARGET_MULTIARCH AND
90+ IS_DIRECTORY "/usr/include/${TARGET_MULTIARCH} " )
91+ set (TARGET_MULTIARCH_INCLUDE "/usr/include/${TARGET_MULTIARCH} " )
92+ elseif (CMAKE_CROSSCOMPILING )
93+ message (FATAL_ERROR
94+ "Failed to determine the target multiarch include directory for cross-compilation" )
8695endif ()
8796execute_process (
8897 COMMAND "${CMAKE_C_COMPILER } " -print-file-name=include
@@ -95,7 +104,6 @@ if(NOT TARGET_COMPILER_INCLUDE_RESULT EQUAL 0 OR
95104 TARGET_COMPILER_INCLUDE STREQUAL "include" )
96105 message (FATAL_ERROR "Failed to determine the target compiler include directory" )
97106endif ()
98- set (TARGET_MULTIARCH_INCLUDE "/usr/include/${TARGET_MULTIARCH} " )
99107
100108set (SYSINTERNALS_EBPF_ROOT "/opt/sysinternalsEBPF" CACHE PATH
101109 "Path containing the target SysinternalsEBPF eBPF resources" )
You can’t perform that action at this time.
0 commit comments