Skip to content

Commit 9a9f788

Browse files
authored
Work around cross-compilation of ONNX by redefining target_compile_features (#1039)
Signed-off-by: Kevin Chen <[email protected]>
1 parent 346bdca commit 9a9f788

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@ if(NOT TARGET onnx_proto)
8989
set(ONNX_NAMESPACE "onnx2trt_onnx")
9090
endif()
9191
add_definitions("-DONNX_NAMESPACE=${ONNX_NAMESPACE}")
92+
# Redefine target_compile_features to avoid cross-compilation issues.
93+
function(target_compile_features)
94+
endfunction()
9295
add_subdirectory(third_party/onnx EXCLUDE_FROM_ALL)
9396
endif()
9497

95-
# CUDA
98+
# Find CUDA
9699
if (NOT CUDA_TOOLKIT_ROOT_DIR)
97100
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda)
98101
endif()

0 commit comments

Comments
 (0)