all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 4279ea37c627b58cde86d2b7f6752d68564ffc1d 2167 bytes (raw)
name: gnu/packages/patches/onnx-use-system-googletest.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
 
ONNX will build googletest from a Git checkout.  Patch CMake to use our
googletest package and enable tests by default.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0aa9fda2..a573170c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
 option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON)
 option(ONNX_WERROR "Build with Werror" OFF)
 option(ONNX_COVERAGE "Build with coverage instrumentation" OFF)
-option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF)
+option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" ON)
 option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
 option(ONNXIFI_ENABLE_EXT "Enable onnxifi extensions." OFF)
 if(NOT DEFINED ONNX_ML)
@@ -82,8 +82,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
 endif()

 if(ONNX_BUILD_TESTS)
-  list(APPEND CMAKE_MODULE_PATH ${ONNX_ROOT}/cmake/external)
-  include(googletest)
+  find_package(GTest REQUIRED)
+  if(NOT GTest_FOUND)
+    message(FATAL_ERROR "cannot find googletest")
+  endif()
 endif()

 if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
diff --git a/cmake/unittest.cmake b/cmake/unittest.cmake
index e71b92a7..30c446ce 100644
--- a/cmake/unittest.cmake
+++ b/cmake/unittest.cmake
@@ -7,7 +7,7 @@ include(${ONNX_ROOT}/cmake/Utils.cmake)

 find_package(Threads)

-set(${UT_NAME}_libs ${googletest_STATIC_LIBRARIES})
+set(${UT_NAME}_libs ${GTEST_LIBRARIES})

 list(APPEND ${UT_NAME}_libs onnx)
 list(APPEND ${UT_NAME}_libs onnx_proto)
@@ -22,10 +22,10 @@ function(AddTest)
   list(REMOVE_DUPLICATES _UT_SOURCES)

   add_executable(${_UT_TARGET} ${_UT_SOURCES})
-  add_dependencies(${_UT_TARGET} onnx onnx_proto googletest)
+  add_dependencies(${_UT_TARGET} onnx onnx_proto)

   target_include_directories(${_UT_TARGET}
-                             PUBLIC ${googletest_INCLUDE_DIRS}
+                             PUBLIC ${GTEST_INCLUDE_DIRS}
                                     ${ONNX_INCLUDE_DIRS}
                                     ${PROTOBUF_INCLUDE_DIRS}
                                     ${ONNX_ROOT}

debug log:

solving 4279ea37c6 ...
found 4279ea37c6 in https://yhetil.org/guix/5bf5b37e1a443ec05011f7acef4a3b96b88b70be.1693415134.git.atai@atai.org/ ||
	https://yhetil.org/guix/a5f1270005a0be3f958485d2395f0238a4eeb757.1693413551.git.atai@atai.org/ ||
	https://yhetil.org/guix/049b3335f4196044edf950e48a0f6f370878426e.1693712577.git.atai@atai.org/ ||
	https://yhetil.org/guix/de14e30c24a0621443d35986d1ecd233f4212cf8.1694375976.git.atai@atai.org/
found 5dfcbc6dc3 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 5dfcbc6dc3170922fb200b07839f2c545530f346	gnu/packages/patches/onnx-use-system-googletest.patch

applying [1/1] https://yhetil.org/guix/5bf5b37e1a443ec05011f7acef4a3b96b88b70be.1693415134.git.atai@atai.org/
diff --git a/gnu/packages/patches/onnx-use-system-googletest.patch b/gnu/packages/patches/onnx-use-system-googletest.patch
index 5dfcbc6dc3..4279ea37c6 100644

Checking patch gnu/packages/patches/onnx-use-system-googletest.patch...
Applied patch gnu/packages/patches/onnx-use-system-googletest.patch cleanly.

skipping https://yhetil.org/guix/a5f1270005a0be3f958485d2395f0238a4eeb757.1693413551.git.atai@atai.org/ for 4279ea37c6
skipping https://yhetil.org/guix/049b3335f4196044edf950e48a0f6f370878426e.1693712577.git.atai@atai.org/ for 4279ea37c6
skipping https://yhetil.org/guix/de14e30c24a0621443d35986d1ecd233f4212cf8.1694375976.git.atai@atai.org/ for 4279ea37c6
index at:
100644 4279ea37c627b58cde86d2b7f6752d68564ffc1d	gnu/packages/patches/onnx-use-system-googletest.patch

(*) 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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.