summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/compatibility.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /third_party/jpeg-xl/lib/compatibility.cmake
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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()