vcpkg/ports/woff2/0001-unofficial-brotli.patch

58 lines
2.0 KiB
Diff
Raw Normal View History

[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
2021-11-24 04:14:06 +08:00
index ecfbb83..420c578 100644
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,13 +34,6 @@ endif()
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
# Find Brotli dependencies
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-find_package(BrotliDec)
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
-if (NOT BROTLIDEC_FOUND)
- message(FATAL_ERROR "librotlidec is needed to build woff2.")
-endif ()
-find_package(BrotliEnc)
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
-if (NOT BROTLIENC_FOUND)
- message(FATAL_ERROR "librotlienc is needed to build woff2.")
-endif ()
+ find_package(unofficial-brotli REQUIRED)
# Set compiler flags
if (NOT CANONICAL_PREFIXES)
@@ -63,9 +73,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAG}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAG}")
set(CMAKE_CXX_STANDARD 11)
-# Set search path for our private/public headers as well as Brotli headers
-include_directories("src" "include"
- "${BROTLIDEC_INCLUDE_DIRS}" "${BROTLIENC_INCLUDE_DIRS}")
+# Set search path for our private/public headers
+include_directories("src" "include")
# Common part used by decoder and encoder
add_library(woff2common
@@ -77,7 +86,7 @@ add_library(woff2common
add_library(woff2dec
src/woff2_dec.cc
src/woff2_out.cc)
-target_link_libraries(woff2dec woff2common "${BROTLIDEC_LIBRARIES}")
+target_link_libraries(woff2dec woff2common unofficial::brotli::brotlidec)
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
add_executable(woff2_decompress src/woff2_decompress.cc)
target_link_libraries(woff2_decompress woff2dec)
@@ -88,7 +97,7 @@ add_library(woff2enc
src/normalize.cc
src/transform.cc
src/woff2_enc.cc)
-target_link_libraries(woff2enc woff2common "${BROTLIENC_LIBRARIES}")
+target_link_libraries(woff2enc woff2common unofficial::brotli::brotlienc)
[woff2] fix for static linking and alternative compiler toolchains (#16392) * [woff2] fix static linking and alternate toolchain First, this change teaches the woff2 CMake configuration to understand the vcpkg's custom unofficial-brotli pkg-config configuration in order to support static linking. This fixes a build failure on x64-linux or other triplets when VCPKG_LIBRARY_LINKAGE is set to static. Secondly, the CANONICAL_PREFIXES option for the woff2 CMake configuration has been changed to be on by default, otherwise custom triplets or toolchains using alternate compilers such as Clang/LLVM or other versions of GCC will fail. Leaving CANONICAL_PREFIXES set to OFF causes -no-canonical-prefixes to be passed to the compiler, which prevents symlinked compiler toolchains from working correctly. If a user does actually need non-canonical prefixes, chances are they will have a custom triplet or toolchain file that passes in -no-canonical-prefixes as a CFLAG for every port, and so setting it to ON here is a better default for vcpkg. * [woff2] update versions * [woff2] update control file * [woff2] update versions * [woff2] update ci.baseline.txt * Update ports/woff2/0001-unofficial-brotli.patch Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [woff2] regenerate 0001-unofficial-brotli.patch file * [woff2] update versions * [woff2] regenerate 0001-unofficial-brotli.patch file attempt #2 * [woff2] update versions Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2021-04-08 05:22:28 +08:00
add_executable(woff2_compress src/woff2_compress.cc)
target_link_libraries(woff2_compress woff2enc)
@@ -264,6 +273,7 @@ if (NOT BUILD_SHARED_LIBS)
install(
TARGETS woff2_decompress woff2_compress woff2_info
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
endif()