mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Link cpuinfo only if supported (#11147)
* Remove unnecessary target_include_directories for cpuinfo
Headers already exposed as public by CMake target: 5916273f79/CMakeLists.txt (L213)
* Link to cpuinfo library only if supported
This commit is contained in:
parent
541eff8d89
commit
1b664e6d4c
2 changed files with 5 additions and 5 deletions
|
|
@ -895,7 +895,6 @@ else()
|
|||
set(CPUINFO_SUPPORTED FALSE)
|
||||
endif()
|
||||
|
||||
# TODO do we have to add target_include_directories to each project that uses this?
|
||||
if (CPUINFO_SUPPORTED)
|
||||
set(PYTORCH_CPUINFO_DIR external/pytorch_cpuinfo)
|
||||
set(PYTORCH_CPUINFO_INCLUDE_DIR ${PYTORCH_CPUINFO_DIR}/include)
|
||||
|
|
|
|||
|
|
@ -210,13 +210,14 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64)
|
|||
# msvc compiler report syntax error with cpuinfo arm source files
|
||||
# and cpuinfo does not have code for getting arm uarch info under windows
|
||||
else()
|
||||
# Link cpuinfo
|
||||
# Link cpuinfo if supported
|
||||
# Using it mainly in ARM with Android.
|
||||
# Its functionality in detecting x86 cpu features are lacking, so is support for Windows.
|
||||
|
||||
target_include_directories(onnxruntime_common PRIVATE ${PYTORCH_CPUINFO_INCLUDE_DIR})
|
||||
target_link_libraries(onnxruntime_common cpuinfo)
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo clog)
|
||||
if (CPUINFO_SUPPORTED)
|
||||
target_link_libraries(onnxruntime_common cpuinfo)
|
||||
list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo clog)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue