summaryrefslogtreecommitdiffstats
path: root/tools/depends/native/libjpeg-turbo/01-disable-executables.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depends/native/libjpeg-turbo/01-disable-executables.patch')
-rw-r--r--tools/depends/native/libjpeg-turbo/01-disable-executables.patch118
1 files changed, 118 insertions, 0 deletions
diff --git a/tools/depends/native/libjpeg-turbo/01-disable-executables.patch b/tools/depends/native/libjpeg-turbo/01-disable-executables.patch
new file mode 100644
index 0000000..8a672b2
--- /dev/null
+++ b/tools/depends/native/libjpeg-turbo/01-disable-executables.patch
@@ -0,0 +1,118 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -211,6 +211,9 @@
+ boolean_number(WITH_TURBOJPEG)
+ option(WITH_FUZZ "Build fuzz targets" FALSE)
+
++option(ENABLE_TESTS "Enable testing targets" FALSE)
++boolean_number(ENABLE_TESTS)
++
+ macro(report_option var desc)
+ if(${var})
+ message(STATUS "${desc} enabled (${var} = ${${var}})")
+@@ -634,6 +637,7 @@
+ LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
+ endif()
+
++if(ENABLE_TESTS)
+ add_executable(tjunittest tjunittest.c tjutil.c md5/md5.c md5/md5hl.c)
+ target_link_libraries(tjunittest turbojpeg)
+
+@@ -645,6 +649,7 @@
+
+ add_executable(tjexample tjexample.c)
+ target_link_libraries(tjexample turbojpeg)
++endif()
+ endif()
+
+ if(ENABLE_STATIC)
+@@ -656,7 +661,7 @@
+ if(NOT MSVC)
+ set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
+ endif()
+-
++if(ENABLE_TESTS)
+ add_executable(tjunittest-static tjunittest.c tjutil.c md5/md5.c
+ md5/md5hl.c)
+ target_link_libraries(tjunittest-static turbojpeg-static)
+@@ -666,6 +671,7 @@
+ if(UNIX)
+ target_link_libraries(tjbench-static m)
+ endif()
++endif()
+ endif()
+ endif()
+
+@@ -680,6 +686,7 @@
+ set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
+ endif()
+
++if(ENABLE_TESTS)
+ if(ENABLE_STATIC)
+ add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c
+ ${CJPEG_BMP_SOURCES})
+@@ -699,11 +706,12 @@
+ add_executable(rdjpgcom rdjpgcom.c)
+
+ add_executable(wrjpgcom wrjpgcom.c)
+-
++endif()
+
+ ###############################################################################
+ # TESTS
+ ###############################################################################
++if(ENABLE_TESTS)
+
+ if(WITH_FUZZ)
+ add_subdirectory(fuzz)
+@@ -1419,7 +1427,7 @@
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tjbenchtest)
+ endif()
+ endif()
+-
++endif()
+
+ ###############################################################################
+ # INSTALLATION
+@@ -1434,8 +1442,10 @@
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
++if(ENABLE_TESTS)
+ install(TARGETS tjbench
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
++endif()
+ if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
+ CMAKE_C_LINKER_SUPPORTS_PDB)
+ install(FILES "$<TARGET_PDB_FILE:turbojpeg>"
+@@ -1452,8 +1462,10 @@
+ else()
+ set(DIR ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
++ if(ENABLE_TESTS)
+ install(PROGRAMS ${DIR}/tjbench-static${EXE}
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE})
++ endif()
+ endif()
+ endif()
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h
+@@ -1464,6 +1476,7 @@
+ install(TARGETS jpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++if(ENABLE_TESTS)
+ if(NOT ENABLE_SHARED)
+ if(MSVC_IDE OR XCODE)
+ set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
+@@ -1478,8 +1491,11 @@
+ DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE})
+ endif()
+ endif()
++endif()
+
++if(ENABLE_TESTS)
+ install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
++endif()
+
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
+ ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt