summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/compatibility.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/jpeg-xl/lib/compatibility.cmake')
-rw-r--r--third_party/jpeg-xl/lib/compatibility.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/third_party/jpeg-xl/lib/compatibility.cmake b/third_party/jpeg-xl/lib/compatibility.cmake
new file mode 100644
index 0000000000..9d99d29482
--- /dev/null
+++ b/third_party/jpeg-xl/lib/compatibility.cmake
@@ -0,0 +1,30 @@
+# Copyright (c) the JPEG XL Project Authors. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+function(jxl_discover_tests TESTNAME)
+ if (CMAKE_VERSION VERSION_LESS "3.10.3")
+ gtest_discover_tests(${TESTNAME} TIMEOUT 240)
+ else ()
+ gtest_discover_tests(${TESTNAME} DISCOVERY_TIMEOUT 240)
+ endif ()
+endfunction()
+
+function(jxl_link_libraries DST SRC)
+ if (CMAKE_VERSION VERSION_LESS "3.13.5")
+ target_include_directories(${DST} SYSTEM PUBLIC
+ $<BUILD_INTERFACE:$<TARGET_PROPERTY:${SRC},INTERFACE_SYSTEM_INCLUDE_DIRECTORIES>>
+ )
+ add_dependencies(${DST} ${SRC})
+ else()
+ target_link_libraries(${DST} PUBLIC ${SRC})
+ endif()
+endfunction()
+
+
+if (CMAKE_VERSION VERSION_LESS "3.12.4")
+ set(JXL_HWY_INCLUDE_DIRS "$<BUILD_INTERFACE:$<TARGET_PROPERTY:hwy,INTERFACE_INCLUDE_DIRECTORIES>>")
+else()
+ set(JXL_HWY_INCLUDE_DIRS "$<BUILD_INTERFACE:$<TARGET_PROPERTY:$<IF:$<TARGET_EXISTS:hwy::hwy>,hwy::hwy,hwy>,INTERFACE_INCLUDE_DIRECTORIES>>")
+endif()