Skip to content

Commit

Permalink
Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed May 29, 2022
1 parent b80f2da commit 9aa2e21
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 58 deletions.
3 changes: 0 additions & 3 deletions recipes/clog/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Having patches create files is tricky with conda
cp ${RECIPE_DIR}/clog-config.cmake.in deps/clog/cmake/clog-config.cmake.in

cd deps/clog
mkdir build
cd build
Expand Down
12 changes: 0 additions & 12 deletions recipes/clog/clog-config.cmake.in

This file was deleted.

1 change: 0 additions & 1 deletion recipes/clog/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ test:
commands:
- test -f ${PREFIX}/lib/libclog${SHLIB_EXT} # [unix]
- test -f ${PREFIX}/include/clog.h # [unix]
- test -f ${PREFIX}/share/clog/clog-config.cmake # [unix]

about:
home: https://github.com/pytorch/QNNPACK/tree/master/deps/clog
Expand Down
19 changes: 1 addition & 18 deletions recipes/clog/shared_lib.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/deps/clog/CMakeLists.txt b/deps/clog/CMakeLists.txt
index ab1840b..596d451 100644
index ab1840b..15e7f8a 100644
--- a/deps/clog/CMakeLists.txt
+++ b/deps/clog/CMakeLists.txt
@@ -51,7 +51,7 @@ IF(CLOG_BUILD_TESTS)
Expand All @@ -11,20 +11,3 @@ index ab1840b..596d451 100644
SET_TARGET_PROPERTIES(clog PROPERTIES
C_STANDARD 99
C_EXTENSIONS NO)
@@ -67,6 +67,16 @@ IF(ANDROID AND NOT CLOG_LOG_TO_STDIO)
TARGET_LINK_LIBRARIES(clog PRIVATE log)
ENDIF()

+
+# support find_package(clog CONFIG)
+INCLUDE(CMakePackageConfigHelpers)
+GET_FILENAME_COMPONENT(CONFIG_FILE_PATH ${CMAKE_CURRENT_BINARY_DIR}/clog-config.cmake ABSOLUTE)
+CONFIGURE_PACKAGE_CONFIG_FILE(
+ cmake/clog-config.cmake.in ${CONFIG_FILE_PATH}
+ INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
+INSTALL(FILES ${CONFIG_FILE_PATH}
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}) # clog_DIR ${prefix}/share/clog
+
INSTALL(TARGETS clog
EXPORT cpuinfo-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
21 changes: 0 additions & 21 deletions recipes/cpuinfo/dont_install_clog.patch

This file was deleted.

5 changes: 2 additions & 3 deletions recipes/cpuinfo/shared_clog.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74364e8..26ff5c2 100644
index 74364e8..a48671a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,17 +250,7 @@ ELSE()
@@ -250,17 +250,6 @@ ELSE()
ENDIF()

# ---[ cpuinfo dependencies: clog
Expand All @@ -17,7 +17,6 @@ index 74364e8..26ff5c2 100644
- # We build static version of clog but a dynamic library may indirectly depend on it
- SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)
-ENDIF()
+find_package(clog)
TARGET_LINK_LIBRARIES(cpuinfo PRIVATE clog)
TARGET_LINK_LIBRARIES(cpuinfo_internals PRIVATE clog)

0 comments on commit 9aa2e21

Please sign in to comment.