Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flac] Disable stack smash protection and FORTIFY_SOURCE for mingw #12761

Merged
merged 2 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/libflac/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: libflac
Version: 1.3.3
Port-Version: 2
Port-Version: 3
Homepage: https://xiph.org/flac/
Description: Library for manipulating FLAC files
Build-Depends: libogg
14 changes: 11 additions & 3 deletions ports/libflac/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ else()
set(BUILD_SHARED_LIBS OFF)
endif()

if(VCPKG_TARGET_IS_MINGW)
set(WITH_STACK_PROTECTOR OFF)
string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0")
string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0")
else()
set(WITH_STACK_PROTECTOR ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -23,7 +31,8 @@ vcpkg_configure_cmake(
-DBUILD_EXAMPLES=OFF
-DBUILD_DOCS=OFF
-DBUILD_TESTING=OFF
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS})
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR})

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(
Expand Down Expand Up @@ -57,5 +66,4 @@ endif()

# This license (BSD) is relevant only for library - if someone would want to install
# FLAC cmd line tools as well additional license (GPL) should be included
file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright)
file(INSTALL ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)