aboutsummaryrefslogtreecommitdiff
path: root/ports/libjpeg-turbo
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:41:51 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:42:54 -0700
commit9f9778ccff48981a691bf34f30ecc4bf2efd5ac1 (patch)
tree10ec609d13836ddc266345f441bae6f9e824056a /ports/libjpeg-turbo
parentece289b9a6466dca885fd2555ed783d70dcad9bf (diff)
downloadvcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.tar.gz
vcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.zip
[many ports] Improve behavior on Linux and general cleanup
Diffstat (limited to 'ports/libjpeg-turbo')
-rw-r--r--ports/libjpeg-turbo/linux-cmake.patch26
-rw-r--r--ports/libjpeg-turbo/portfile.cmake5
2 files changed, 29 insertions, 2 deletions
diff --git a/ports/libjpeg-turbo/linux-cmake.patch b/ports/libjpeg-turbo/linux-cmake.patch
new file mode 100644
index 000000000..48a04279f
--- /dev/null
+++ b/ports/libjpeg-turbo/linux-cmake.patch
@@ -0,0 +1,26 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c29e604..6e467be 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -29,10 +29,6 @@ pad_number(VERSION_MINOR 3)
+ pad_number(VERSION_REVISION 3)
+ set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
+
+-if(NOT WIN32)
+- message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
+-endif()
+-
+ string(TIMESTAMP BUILD "%Y%m%d")
+
+ # This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning
+@@ -166,8 +162,10 @@ endif()
+
+ if(64BIT)
+ message(STATUS "64-bit build")
++ add_compile_options(-DSIZEOF_SIZE_T=8)
+ else()
+ message(STATUS "32-bit build")
++ add_compile_options(-DSIZEOF_SIZE_T=4)
+ endif()
+
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake
index a3c0e65b6..2c8c20f92 100644
--- a/ports/libjpeg-turbo/portfile.cmake
+++ b/ports/libjpeg-turbo/portfile.cmake
@@ -10,9 +10,10 @@ vcpkg_from_github(
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/add-options-for-exes-docs-headers.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/linux-cmake.patch"
)
-if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF)
else()
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=ON)
@@ -41,7 +42,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
# Rename libraries for static builds
-if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib")