Skip to content

Commit 3740c35

Browse files
salilsdesaifacebook-github-bot
authored andcommitted
[QNNPACK] Export cpuinfo-targets in clog CMakeLists (#84876)
Summary: Pull Request resolved: #84876 Fixes the following error when building qnnpack: ``` CMake Error: install(EXPORT "cpuinfo-targets" ...) includes target "cpuinfo" which requires target "clog" that is not in any export set. ``` This diff mirrors the changes to the CMakeLists of - pytorch/cpuinfo#69 - pytorch/cpuinfo#89 Test Plan: # Build Qnnpack ``` export ANDROID_NDK=/opt/android_ndk/r20 export ANDROID_NDK_HOME=${ANDROID_NDK} export ANDROID_SDK=/opt/android_sdk export ANDROID_HOME=${ANDROID_SDK} cd ~/fbsource/fbcode/caffe2/aten/src/ATen/native/quantized/cpu/qnnpack ./scripts/build-android-arm64.sh ``` Succeeds Differential Revision: D39438768 fbshipit-source-id: 9bd0119ffea984d274e85b8b756b630743a89f0f
1 parent 2e1ec5d commit 3740c35

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

aten/src/ATen/native/quantized/cpu/qnnpack/deps/clog/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ set_target_properties(clog PROPERTIES
6363
C_EXTENSIONS NO)
6464
CLOG_TARGET_RUNTIME_LIBRARY(clog)
6565
set_target_properties(clog PROPERTIES PUBLIC_HEADER include/clog.h)
66-
target_include_directories(clog BEFORE PUBLIC include)
66+
target_include_directories(clog PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
6767
if(CLOG_LOG_TO_STDIO)
6868
target_compile_definitions(clog PRIVATE CLOG_LOG_TO_STDIO=1)
6969
else()
@@ -73,7 +73,10 @@ if(ANDROID AND NOT CLOG_LOG_TO_STDIO)
7373
target_link_libraries(clog PRIVATE log)
7474
endif()
7575

76+
add_library(cpuinfo::clog ALIAS clog)
77+
7678
install(TARGETS clog
79+
EXPORT cpuinfo-targets
7780
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
7881
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
7982
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

0 commit comments

Comments
 (0)