Skip to content
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: 2 additions & 0 deletions docs/maintainers/vcpkg_check_linkage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ vcpkg_check_linkage(
### ONLY_STATIC_LIBRARY
Indicates that this port can only be built with static library linkage.

Note: If the user requested a dynamic build ONLY_STATIC_LIBRARY will result in a note being printed, not a fatal error.

### ONLY_DYNAMIC_LIBRARY
Indicates that this port can only be built with dynamic/shared library linkage.

Expand Down
2 changes: 1 addition & 1 deletion ports/libpq/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: libpq
Version: 12.2
Port-Version: 10
Port-Version: 11
Build-Depends: libpq[core,bonjour] (osx)
Supports: !uwp
Homepage: https://www.postgresql.org/
Expand Down
4 changes: 2 additions & 2 deletions ports/libpq/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ else()
if(NOT HAS_TOOLS)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
else()
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/${PORT})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug)
endif()
set(USE_DL ON)
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/pugixml/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: pugixml
Version: 1.11.1
Version: 1.11.4
Homepage: https://github.com/zeux/pugixml
Description: Light-weight, simple and fast XML parser for C++ with XPath support
4 changes: 2 additions & 2 deletions ports/pugixml/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO zeux/pugixml
REF v1.11.1
SHA512 94a79a28d96e763cdd8951c4d0b20aefb43cd1b32cbf5a5354b09f2636710e960e2dbfa56534b61c8d6ddecb2126a006e5f485c1465a97376e1cc077df25f16e
REF v1.11.4
SHA512 a1fdf4cbd744318fd339362465472279767777b18a3c8c7e8618d5e637213c632bf9dd8144d16ae22a75cfbde007f383e2feb49084e681c930fc89a2e3f2bc4f
HEAD_REF master
)

Expand Down
1 change: 1 addition & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ paho-mqtt:arm-uwp=fail
paho-mqtt:x64-uwp=fail
pangomm:x64-osx=fail
pangomm:arm64-windows=fail
paraview:x64-linux=fail
parmetis:x64-linux=fail
parmetis:x64-osx=fail
pdal:x64-linux=fail
Expand Down
2 changes: 2 additions & 0 deletions scripts/cmake/vcpkg_check_linkage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ vcpkg_check_linkage(
### ONLY_STATIC_LIBRARY
Indicates that this port can only be built with static library linkage.

Note: If the user requested a dynamic build ONLY_STATIC_LIBRARY will result in a note being printed, not a fatal error.

### ONLY_DYNAMIC_LIBRARY
Indicates that this port can only be built with dynamic/shared library linkage.

Expand Down
43 changes: 41 additions & 2 deletions scripts/cmake/vcpkg_configure_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ macro(_vcpkg_determine_autotools_target_cpu out_var)
endif()
endmacro()

macro(_vcpkg_determine_autotools_host_arch_mac out_var)
set(${out_var} "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}")
endmacro()

macro(_vcpkg_determine_autotools_target_arch_mac out_var)
list(LENGTH VCPKG_OSX_ARCHITECTURES _num_osx_archs)
if(_num_osx_archs GREATER_EQUAL 2)
set(${out_var} "universal")
else()
# Better match the arch behavior of config.guess
# See: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
if(VCPKG_OSX_ARCHITECTURES MATCHES "^(ARM|arm)64$")
set(${out_var} "aarch64")
else()
set(${out_var} "${VCPKG_OSX_ARCHITECTURES}")
endif()
endif()
unset(_num_osx_archs)
endmacro()

macro(_vcpkg_backup_env_variable envvar)
if(DEFINED ENV{${envvar}})
set(${envvar}_BACKUP "$ENV{${envvar}}")
Expand Down Expand Up @@ -407,6 +427,25 @@ function(vcpkg_configure_make)
set(prefix_var "\${prefix}")
endif()

# macOS - cross-compiling support
if(VCPKG_TARGET_IS_OSX)
if (_csc_AUTOCONFIG AND NOT _csc_BUILD_TRIPLET OR _csc_DETERMINE_BUILD_TRIPLET)
_vcpkg_determine_autotools_host_arch_mac(BUILD_ARCH) # machine you are building on => --build=
_vcpkg_determine_autotools_target_arch_mac(TARGET_ARCH)
# --build: the machine you are building on
# --host: the machine you are building for
# --target: the machine that CC will produce binaries for
# https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler
# Only for ports using autotools so we can assume that they follow the common conventions for build/target/host
set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-apple-darwin")
if(NOT "${TARGET_ARCH}" STREQUAL "${BUILD_ARCH}") # we don't need to specify the additional flags if we build natively.

list(APPEND _csc_BUILD_TRIPLET "--host=${TARGET_ARCH}-apple-darwin") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target)
endif()
debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}")
endif()
endif()

# Cleanup previous build dirs
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
Expand Down Expand Up @@ -671,8 +710,8 @@ function(vcpkg_configure_make)
if (CMAKE_HOST_WIN32)
set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}")
else()
find_program(BASH bash REQUIRED)
set(command "${BASH}" "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}})
find_program(BASH bash REQUIRED)
set(command "${BASH}" "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}})
endif()
if(_csc_ADD_BIN_TO_PATH)
set(PATH_BACKUP $ENV{PATH})
Expand Down
32 changes: 26 additions & 6 deletions scripts/get_cmake_vars/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ foreach(flag IN LISTS FLAGS)
endforeach()
list(REMOVE_DUPLICATES VCPKG_DEFAULT_FLAGS_TO_CHECK)

#Language-specific flags.
foreach(_lang IN LISTS VCPKG_LANGUAGES)
list(APPEND VCPKG_LANG_FLAGS CMAKE_${_lang}_FLAGS)
endforeach()
list(REMOVE_DUPLICATES VCPKG_LANG_FLAGS)

# TODO if ever necessary: Properties to check

set(VCPKG_VAR_PREFIX "VCPKG_DETECTED" CACHE STRING "Variable prefix to use for detected flags")
Expand Down Expand Up @@ -81,17 +87,31 @@ foreach(_env IN LISTS VCPKG_ENV_VARS_TO_CHECK)
endif()
endforeach()

macro(_vcpkg_adjust_flags flag_var)
if(MSVC) # Transform MSVC /flags to -flags due to bash scripts intepreting /flag as a path.
string(REGEX REPLACE "(^| )/" "\\1-" ${flag_var} "${${flag_var}}")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if("${flag_var}" IN_LIST VCPKG_LANG_FLAGS)
# macOS - append arch and isysroot if cross-compiling
if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")

foreach(arch IN LISTS CMAKE_OSX_ARCHITECTURES)
string(APPEND ${flag_var} " -arch ${arch}")
endforeach()
string(APPEND ${flag_var} " -isysroot ${CMAKE_OSX_SYSROOT}")
endif()
endif()
endif()
endmacro()

foreach(flag IN LISTS VCPKG_FLAGS_TO_CHECK)
string(STRIP "${${flag}}" ${flag}) # Strip leading and trailing whitespaces
if(MSVC) # Transform MSVC /flags to -flags due to bash scripts intepreting /flag as a path.
string(REGEX REPLACE "(^| )/" "\\1-" ${flag} "${${flag}}")
endif()
_vcpkg_adjust_flags(${flag})
string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_RAW_${flag} \" ${${flag}}\")\n")
foreach(config IN LISTS VCPKG_CONFIGS)
string(STRIP "${${flag}_${config}}" ${flag}_${config})
if(MSVC)
string(REGEX REPLACE "(^| )/" "\\1-" ${flag}_${config} "${${flag}_${config}}")
endif()
_vcpkg_adjust_flags(${flag}_${config})
string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_RAW_${flag}_${config} \"${CMAKE_${flag}_FLAGS_${config}}\")\n")
set(COMBINED_${flag}_${config} "${${flag}} ${${flag}_${config}}")
string(STRIP "${COMBINED_${flag}_${config}}" COMBINED_${flag}_${config})
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3238,7 +3238,7 @@
},
"libpq": {
"baseline": "12.2",
"port-version": 10
"port-version": 11
},
"libpqxx": {
"baseline": "7.3.1",
Expand Down Expand Up @@ -4705,7 +4705,7 @@
"port-version": 0
},
"pugixml": {
"baseline": "1.11.1",
"baseline": "1.11.4",
"port-version": 0
},
"pybind11": {
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libpq.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e09ebfc1a310be48ed9f5f3e6d2a648cfddff424",
"version-string": "12.2",
"port-version": 11
},
{
"git-tree": "7c4dbe4fcb780bed98e6b55ccf039b77c7a5be68",
"version-string": "12.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pugixml.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "64fda47a7f4dd9fc10c60169c4f5e0b069481199",
"version-string": "1.11.4",
"port-version": 0
},
{
"git-tree": "3c0bf3af0be3a7df2f1ee8f65223b6fc49947b35",
"version-string": "1.11.1",
Expand Down