Skip to content

Commit

Permalink
[boost] bugfix and new features after update to 1.77.0 (microsoft#20432)
Browse files Browse the repository at this point in the history
* [scripts/boost] fix issue microsoft#20417
[boost-iostreams] replace explicit dependencies with default-features, allow to disable compression filters

* add versions

* [scripts/boost] update port version after microsoft#20421

* [boost-odeint] move boost-mpi dependency to the feature

* add version

* [boost-modular-build-helper] rework user-config generation

* [boost-python] move python3 from explicit dependency to default feature

* [boost-modular-build-helper] update version

* add verions

* [boost-modular-build-helper] fix empty flags

* update version

* Fix compilation on Emscripten / WebAssembly (microsoft#20551)

* [opencv4,opencv3] Control exported protobuf dependency (microsoft#20550)

* Control exported protobuf dependency

* Update versions

* Control exported protobuf dependency

* Update versions

* [OpenMVS] restore deprecated cmake scripts for configure, build & fixup targets (microsoft#20422)

* [OpenMVS] restore deprecated cmake scripts

* [OpenMVS] fix references

* switch back to vcpkg_cmake_*

Co-authored-by: nicole mazzuca <[email protected]>

* [libffi] Don't replace string in file that doesn't exist. (microsoft#20554)

* Don't replace string in file that doesn't exist.

* Update per bot.

* Update per bot again.

* Address comments.

* [json-dto] Update to 0.2.14 (microsoft#20570)

* json-dto updated to v.0.2.14.

* json-dto-0.2.14 added to baseline.

* Change deprecated commands.

* Update baseline for fresh json-dto-0.2.14.

* [sail] Update to 0.9.0-pre17 (microsoft#20562)

* [sail] Update to 0.9.0-pre17

* [sail] vcpkg x-add-version --all --overwrite-version

* [sail] Update pre17 hash

* [sail] vcpkg x-add-version --all --overwrite-version

* [freexl] Update to 1.0.6 (microsoft#20520)

* Reformat portfile

* Minimize makefiles patch

* Update to 1.0.6

* Fix uwp builds, remove skip from baseline

* Install pc file for windows

* Update versions

Co-authored-by: Billy Robert O'Neal III <[email protected]>

* [dartsim] Update to 6.11.0 (microsoft#20566)

* Update dartsim

* Use newer vcpkg functions

* Update version number

* Update ports/dartsim/portfile.cmake

Co-authored-by: Robert Schumacher <[email protected]>

* Update versions

Co-authored-by: Robert Schumacher <[email protected]>

* [scripts/boost] update Boost version in boost-modular-build.cmake to avoid manual changes

* update version

* [boost-modular-build-helper] fix USER_CONFIG_EXTRA_LINES variable name and rename generated files

* update version

* Resolve differences from rerunning generate-ports.ps1.

Co-authored-by: Billy Robert O'Neal III <[email protected]>
Co-authored-by: Tobias Markus <[email protected]>
Co-authored-by: Kai Pastor <[email protected]>
Co-authored-by: Stefano Sinigardi <[email protected]>
Co-authored-by: nicole mazzuca <[email protected]>
Co-authored-by: Lars Glud <[email protected]>
Co-authored-by: eao197 <[email protected]>
Co-authored-by: Dmitry Baryshev <[email protected]>
Co-authored-by: Akash <[email protected]>
Co-authored-by: Robert Schumacher <[email protected]>
  • Loading branch information
11 people authored Oct 12, 2021
1 parent e29e78d commit f904f73
Show file tree
Hide file tree
Showing 25 changed files with 397 additions and 200 deletions.
3 changes: 1 addition & 2 deletions ports/boost-config/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ vcpkg_from_github(
REF boost-1.77.0
SHA512 c6df16825b7bb27412667e00b6b6cdecbf56ee0707aa1df3505637c7de5c39c87335fabd7cd4361b29625d71c7664e6af865fc271ad0b3e70cc8872825f6155e
HEAD_REF master
PATCHES
fix-emscripten-compilation.patch
PATCHES fix-emscripten-compilation.patch
)

include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake)
Expand Down
2 changes: 1 addition & 1 deletion ports/boost-config/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "boost-config",
"version": "1.77.0",
"port-version": 1,
"port-version": 2,
"description": "Boost config module",
"homepage": "https://github.com/boostorg/config",
"dependencies": [
Expand Down
102 changes: 79 additions & 23 deletions ports/boost-iostreams/b2-options.cmake
Original file line number Diff line number Diff line change
@@ -1,30 +1,86 @@
list(APPEND B2_OPTIONS
-sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
-sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
-sLZMA_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
-sZSTD_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
)

if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(lib_suffix lib)
set(lib_path_suffix lib)
else()
set(lib_path_suffix debug/lib)
endif()

if("bzip2" IN_LIST FEATURES)
list(APPEND B2_OPTIONS
-sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
)
# Overwride debug library name
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND B2_OPTIONS
-sBZIP2_NAME=bz2d
)
endif()
list(APPEND B2_OPTIONS
-sBZIP2_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}"
)
else()
list(APPEND B2_OPTIONS
-sNO_BZIP2=1
)
endif()

if("lzma" IN_LIST FEATURES)
list(APPEND B2_OPTIONS
-sLZMA_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
)
# Overwride debug library name
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND B2_OPTIONS
-sLZMA_NAME=lzmad
)
endif()
list(APPEND B2_OPTIONS
-sLZMA_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}"
)
else()
set(lib_suffix debug/lib)
if(WIN32)
set(ZLIB_NAME zlibd)
else()
set(ZLIB_NAME z)
list(APPEND B2_OPTIONS
-sNO_LZMA=1
)
endif()

if("zlib" IN_LIST FEATURES)
list(APPEND B2_OPTIONS
-sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
)
# Overwride debug library name
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(WIN32)
set(ZLIB_NAME zlibd)
else()
set(ZLIB_NAME z)
endif()
list(APPEND B2_OPTIONS
-sZLIB_NAME=${ZLIB_NAME}
)
endif()
list(APPEND B2_OPTIONS
-sZLIB_NAME=${ZLIB_NAME}
-sBZIP2_NAME=bz2d
-sLZMA_NAME=lzmad
-sZSTD_BINARY=zstdd
-sZLIB_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}"
)
else()
list(APPEND B2_OPTIONS
-sNO_ZLIB=1
)
endif()

list(APPEND B2_OPTIONS
-sZLIB_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}"
-sBZIP2_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}"
-sLZMA_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}"
-sZSTD_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}"
)
if("zstd" IN_LIST FEATURES)
list(APPEND B2_OPTIONS
-sZSTD_INCLUDE="${CURRENT_INSTALLED_DIR}/include"
)
# Overwride debug library name
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND B2_OPTIONS
-sZSTD_NAME=zstdd
)
endif()
list(APPEND B2_OPTIONS
-sZSTD_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}"
)
else()
list(APPEND B2_OPTIONS
-sNO_ZSTD=1
)
endif()
37 changes: 33 additions & 4 deletions ports/boost-iostreams/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "boost-iostreams",
"version": "1.77.0",
"port-version": 1,
"description": "Boost iostreams module",
"homepage": "https://github.com/boostorg/iostreams",
"supports": "!uwp",
Expand Down Expand Up @@ -32,13 +33,41 @@
"boost-type-traits",
"boost-utility",
"boost-vcpkg-helpers",
"bzip2",
"liblzma",
{
"name": "vcpkg-cmake",
"host": true
},
}
],
"default-features": [
"bzip2",
"lzma",
"zlib",
"zstd"
]
],
"features": {
"bzip2": {
"description": "Support bzip2 filters",
"dependencies": [
"bzip2"
]
},
"lzma": {
"description": "Support LZMA/xz filters",
"dependencies": [
"liblzma"
]
},
"zlib": {
"description": "Support zlib filters",
"dependencies": [
"zlib"
]
},
"zstd": {
"description": "Support zstd filters",
"dependencies": [
"zstd"
]
}
}
}
99 changes: 64 additions & 35 deletions ports/boost-modular-build-helper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
cmake_minimum_required(VERSION 3.9)
project(boost CXX)

set(B2_OPTIONS)
# The following variables are used in user-config.jam file
set(USER_CONFIG_TOOLSET)
set(USER_CONFIG_TOOLSET_VERSION)
set(USER_CONFIG_TOOLSET_INVOCATION_COMMAND)
set(USER_CONFIG_TOOLSET_OPTIONS)
set(USER_CONFIG_EXTRA_LINES)

if(MSVC)
if(MSVC_VERSION LESS 1900)
math(EXPR BOOST_MSVC_VERSION "${MSVC_VERSION} / 10 - 60")
else()
math(EXPR BOOST_MSVC_VERSION "${MSVC_VERSION} / 10 - 50")
endif()
else()
set(VCPKG_PLATFORM_TOOLSET external)
endif()
set(B2_OPTIONS)

#### Handle ICU
if(WIN32)
Expand All @@ -24,10 +21,8 @@ endif()
# Add build type specific options
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND B2_OPTIONS runtime-link=shared)
set(LIB_RUNTIME_LINK "shared")
else()
list(APPEND B2_OPTIONS runtime-link=static)
set(LIB_RUNTIME_LINK "static")
endif()

if(BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -56,31 +51,28 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND WIN32)
list(APPEND B2_OPTIONS "asmflags=/safeseh")
endif()

file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/nothing.bat" NOTHING_BAT)

if(MSVC)
set(B2_TOOLSET msvc)
set(USER_CONFIG_TOOLSET msvc)
if(MSVC_VERSION LESS 1900)
math(EXPR USER_CONFIG_TOOLSET_VERSION "${MSVC_VERSION} / 10 - 60")
else()
math(EXPR USER_CONFIG_TOOLSET_VERSION "${MSVC_VERSION} / 10 - 50")
endif()
list(APPEND B2_OPTIONS target-os=windows)
elseif(APPLE)
set(B2_TOOLSET clang)
set(USER_CONFIG_TOOLSET clang)
list(APPEND B2_OPTIONS target-os=darwin)
elseif(WIN32)
set(B2_TOOLSET gcc)
set(USER_CONFIG_TOOLSET gcc)
list(APPEND B2_OPTIONS target-os=windows)
elseif(ANDROID)
set(B2_TOOLSET gcc)
set(USER_CONFIG_TOOLSET gcc)
list(APPEND B2_OPTIONS target-os=android)
else()
set(B2_TOOLSET gcc)
set(USER_CONFIG_TOOLSET gcc)
list(APPEND B2_OPTIONS target-os=linux)
endif()

if(WIN32)
list(APPEND B2_OPTIONS threadapi=win32)
else()
list(APPEND B2_OPTIONS threadapi=pthread)
endif()

# Properly handle compiler and linker flags passed by VCPKG
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
Expand Down Expand Up @@ -122,9 +114,12 @@ if(APPLE)
endforeach()
endif()

string(REGEX REPLACE "[ \t\r\n]+" " " CXXFLAGS "${CXXFLAGS}")
string(STRIP "${CXXFLAGS}" CXXFLAGS)
string(STRIP "${CFLAGS}" CFLAGS)
string(STRIP "${LDFLAGS}" LDFLAGS)
string(REGEX REPLACE "[ \t\r\n]+" " " CFLAGS "${CFLAGS}")
string(STRIP "${CFLAGS}" CFLAGS)
string(REGEX REPLACE "[ \t\r\n]+" " " LDFLAGS "${LDFLAGS}")
string(STRIP "${LDFLAGS}" LDFLAGS)

if(NOT CXXFLAGS STREQUAL "")
string(REPLACE " " " <cxxflags>" CXXFLAGS "<cxxflags>${CXXFLAGS}")
Expand Down Expand Up @@ -187,6 +182,39 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND B2_OPTIONS linkflags=WindowsApp.lib)
endif()

set(USER_CONFIG_TOOLSET_INVOCATION_COMMAND "\"${CMAKE_CXX_COMPILER}\"")

if(USER_CONFIG_TOOLSET STREQUAL "msvc")
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/nothing.bat" NOTHING_BAT)
string(APPEND USER_CONFIG_TOOLSET_OPTIONS
" <setup>\"${NOTHING_BAT}\"\n"
" ${CXXFLAGS}\n"
" ${CFLAGS}\n"
" ${LDFLAGS}\n"
)
else()
string(APPEND USER_CONFIG_TOOLSET_OPTIONS
" <ranlib>\"${CMAKE_RANLIB}\"\n"
" <archiver>\"${CMAKE_AR}\"\n"
" ${CXXFLAGS}\n"
" ${CFLAGS}\n"
" ${LDFLAGS}\n"
)
endif()

if(WIN32 AND NOT USER_CONFIG_TOOLSET STREQUAL "msvc")
# MINGW here causes b2 to not run cygpath
string(APPEND USER_CONFIG_TOOLSET_OPTIONS
" <flavor>mingw\n"
)
endif()

if(WIN32)
list(APPEND B2_OPTIONS threadapi=win32)
else()
list(APPEND B2_OPTIONS threadapi=pthread)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Release")
list(APPEND B2_OPTIONS variant=release)
else()
Expand All @@ -197,23 +225,23 @@ if(NOT WIN32)
list(APPEND B2_OPTIONS "--layout=system")
endif()

include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROCESSORS)
if(NOT NUMBER_OF_PROCESSORS)
set(NUMBER_OF_PROCESSORS 1)
endif()

# Include port specific CMake fragment
if(DEFINED BOOST_CMAKE_FRAGMENT)
message(STATUS "Including ${BOOST_CMAKE_FRAGMENT}")
include(${BOOST_CMAKE_FRAGMENT})
endif()

configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY)

include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROCESSORS)
if(NOT NUMBER_OF_PROCESSORS)
set(NUMBER_OF_PROCESSORS 1)
endif()
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam.in ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY)

add_custom_target(boost ALL
COMMAND "${B2_EXE}"
toolset=${B2_TOOLSET}
toolset=${USER_CONFIG_TOOLSET}
--user-config=${CMAKE_CURRENT_BINARY_DIR}/user-config.jam
--stagedir=${CMAKE_CURRENT_BINARY_DIR}/stage
--build-dir=${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -235,6 +263,7 @@ add_custom_target(boost ALL
--hash
-q
debug-symbols=on
# Enable debugging level 2.
-d +2

threading=multi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
constant BOOST_VERSION : 1.77.0 ;
constant BOOST_VERSION_ABI_TAG : 1_77 ;
constant BOOST_VERSION : @BOOST_VERSION@ ;
constant BOOST_VERSION_ABI_TAG : @BOOST_VERSION_ABI_TAG@ ;
constant BOOST_JAMROOT_MODULE : $(__name__) ;

import boostcpp ;
Expand Down
Loading

0 comments on commit f904f73

Please sign in to comment.