projects/guix·blob python-team · refs

60 lines · 1.8 KiB

1Use the asmjit and cpuinfo packages.
2
3diff --git i/CMakeLists.txt w/CMakeLists.txt
4index e645fc81..9fc95a17 100644
5--- i/CMakeLists.txt
6+++ w/CMakeLists.txt
7@@ -53,7 +53,7 @@ endfunction()
8 project(
9 fbgemm
10 VERSION 1.4.0
11- LANGUAGES CXX)
12+ LANGUAGES C CXX)
13
14 # Add C++ compiler flag detection
15 include(CheckCXXCompilerFlag)
16@@ -447,7 +447,22 @@ install(
17 # Asmjit Target
18 ################################################################################
19
20+find_package(asmjit REQUIRED)
21+find_package(PkgConfig REQUIRED)
22+pkg_check_modules(libcpuinfo REQUIRED IMPORTED_TARGET libcpuinfo)
23+
24+# Keep the upstream target names expected by DEPS throughout this file,
25+# while wiring them to system-installed packages.
26 if(NOT TARGET asmjit)
27+ add_library(asmjit INTERFACE IMPORTED)
28+ target_link_libraries(asmjit INTERFACE asmjit::asmjit)
29+endif()
30+if(NOT TARGET cpuinfo)
31+ add_library(cpuinfo INTERFACE IMPORTED)
32+ target_link_libraries(cpuinfo INTERFACE PkgConfig::libcpuinfo)
33+endif()
34+
35+if(FALSE)
36 # Download asmjit from github if ASMJIT_SRC_DIR is not specified.
37 if(NOT DEFINED ASMJIT_SRC_DIR)
38 set(ASMJIT_SRC_DIR "${FBGEMM_SOURCE_DIR}/external/asmjit"
39@@ -469,7 +484,7 @@ endif()
40 # Cpuinfo Target
41 ################################################################################
42
43-if(NOT TARGET cpuinfo)
44+if(FALSE)
45 #Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified.
46 if(NOT DEFINED CPUINFO_SOURCE_DIR)
47 set(CPUINFO_SOURCE_DIR "${FBGEMM_SOURCE_DIR}/external/cpuinfo"
48diff --git i/test/CMakeLists.txt w/test/CMakeLists.txt
49index d687e8dc..546540dd 100644
50--- i/test/CMakeLists.txt
51+++ w/test/CMakeLists.txt
52@@ -10,7 +10,7 @@
53
54 find_package(GTest)
55
56-if(NOT GTest_FOUND)
57+if(FALSE)
58 # Download Googletest framework from github if
59 # GOOGLETEST_SOURCE_DIR is not specified.
60 set(INSTALL_GTEST OFF)