blob: 23b8a1aeca90e1af820d1317384af7e882f218d7 (
plain)
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
|
--- apitrace-11.1/CMakeLists.txt 2022-05-21 00:14:48.000000000 +1000
+++ apitrace-11.1-patched/CMakeLists.txt 2023-09-23 08:21:56.858903298 +1000
@@ -492,7 +492,9 @@
pkg_check_modules (BROTLIENC IMPORTED_TARGET libbrotlienc>=1.0.7)
endif ()
- find_package (GTest)
+ if (BUILD_TESTING)
+ find_package (GTest)
+ endif ()
endif ()
add_subdirectory (thirdparty)
@@ -504,12 +506,15 @@
include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khronos)
# Convenience macro for adding unit tests
-macro (add_gtest)
- add_executable (${ARGV})
- target_link_libraries (${ARGV0} GTest::GTest)
- add_dependencies (check ${ARGV0})
- add_test (NAME ${ARGV0} COMMAND ${ARGV0})
-endmacro ()
+# Should only be invoked when BUILD_TESTING is enabled
+if (BUILD_TESTING)
+ macro (add_gtest)
+ add_executable (${ARGV})
+ target_link_libraries (${ARGV0} GTest::GTest)
+ add_dependencies (check ${ARGV0})
+ add_test (NAME ${ARGV0} COMMAND ${ARGV0})
+ endmacro ()
+endif ()
##############################################################################
--- apitrace-11.1/thirdparty/CMakeLists.txt 2022-05-21 00:14:48.000000000 +1000
+++ apitrace-11.1-patched/thirdparty/CMakeLists.txt 2023-09-23 08:21:56.859903298 +1000
@@ -23,12 +23,12 @@
zlib/README
)
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
- message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist")
+ message (STATUS "${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist, relying on system version")
set (SUBMODULES_MISSING TRUE)
endif ()
endforeach ()
if (SUBMODULES_MISSING)
- message (FATAL_ERROR "Update Git submodules by running\ngit submodule update --init --depth 1 --recursive")
+ message (WARNING "If any dependencies are not found, update Git submodules by running\ngit submodule update --init --depth 1 --recursive")
endif ()
if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND)
@@ -56,7 +56,7 @@
endif ()
# We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt
-if (NOT GTEST_FOUND)
+if (BUILD_TESTING AND NOT GTEST_FOUND)
message (STATUS "Using bundled GTest")
include_with_scope (gtest.cmake)
endif ()
|