unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 456bc3021caf788018cac007879c1059ca2196ad 2053 bytes (raw)
name: gnu/packages/patches/fbgemm-use-system-libraries.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
Use the asmjit and cpuinfo packages.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 134523e..b88b0e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,7 +235,7 @@ message(WARNING "CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}")
 message(WARNING "CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}")
 message(WARNING "==========")
 
-if(NOT TARGET asmjit)
+if(FALSE)
   #Download asmjit from github if ASMJIT_SRC_DIR is not specified.
   if(NOT DEFINED ASMJIT_SRC_DIR)
     set(ASMJIT_SRC_DIR "${FBGEMM_SOURCE_DIR}/third_party/asmjit"
@@ -264,7 +264,7 @@ if(NOT TARGET asmjit)
   endif()
 endif()
 
-if(NOT TARGET cpuinfo)
+if(FALSE)
   #Download cpuinfo from github if CPUINFO_SOURCE_DIR is not specified.
   if(NOT DEFINED CPUINFO_SOURCE_DIR)
     set(CPUINFO_SOURCE_DIR "${FBGEMM_SOURCE_DIR}/third_party/cpuinfo"
@@ -340,9 +340,12 @@ target_include_directories(fbgemm BEFORE
 target_link_libraries(fbgemm
   $<BUILD_INTERFACE:asmjit>
   $<BUILD_INTERFACE:cpuinfo>)
-add_dependencies(fbgemm
-  asmjit
-  cpuinfo)
+
+find_package(asmjit)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(libcpuinfo REQUIRED IMPORTED_TARGET libcpuinfo)
+
+target_link_libraries(fbgemm asmjit::asmjit PkgConfig::libcpuinfo)
 
 if(OpenMP_FOUND)
   target_link_libraries(fbgemm OpenMP::OpenMP_CXX)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2cffddf..bd4d409 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,7 +14,7 @@ set(CMAKE_C_STANDARD 11)
 set(CMAKE_C_EXTENSIONS OFF)
 set(CMAKE_C_STANDARD_REQUIRED ON)
 
-if(FBGEMM_BUILD_TESTS AND NOT TARGET gtest)
+if(FALSE)
   #Download Googletest framework from github if
   #GOOGLETEST_SOURCE_DIR is not specified.
   if(NOT DEFINED GOOGLETEST_SOURCE_DIR)
@@ -78,7 +78,7 @@ macro(add_gtest TESTNAME)
     target_link_libraries(${TESTNAME} ${OpenMP_CXX_LIBRARIES})
   endif()
 
-  add_dependencies(${TESTNAME} gtest fbgemm)
+  add_dependencies(${TESTNAME} fbgemm)
   add_test(${TESTNAME} ${TESTNAME})
   set_target_properties(${TESTNAME} PROPERTIES FOLDER test)
 endmacro()

debug log:

solving 456bc3021c ...
found 456bc3021c in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).