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

[boost] bugfix and new features after update to 1.77.0 #20432

Merged
merged 29 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e20ab2
[scripts/boost] fix issue #20417
yurybura Sep 29, 2021
48e32a5
add versions
yurybura Sep 29, 2021
7cdf9b2
Merge branch 'master' of https://github.com/microsoft/vcpkg into boos…
yurybura Sep 29, 2021
fc51d8e
[scripts/boost] update port version after #20421
yurybura Sep 29, 2021
fdd2852
[boost-odeint] move boost-mpi dependency to the feature
yurybura Sep 30, 2021
0841f43
add version
yurybura Sep 30, 2021
7ff3352
[boost-modular-build-helper] rework user-config generation
yurybura Oct 2, 2021
789f899
[boost-python] move python3 from explicit dependency to default feature
yurybura Oct 2, 2021
9434a46
[boost-modular-build-helper] update version
yurybura Oct 2, 2021
dce8f35
add verions
yurybura Oct 2, 2021
f599962
[boost-modular-build-helper] fix empty flags
yurybura Oct 4, 2021
bf2efcd
update version
yurybura Oct 4, 2021
5f42a9d
Merge branch 'master' of https://github.com/microsoft/vcpkg into boos…
yurybura Oct 6, 2021
459000e
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Oct 6, 2021
76dcc5a
Fix compilation on Emscripten / WebAssembly (#20551)
tobbi Oct 6, 2021
bd9bf42
[opencv4,opencv3] Control exported protobuf dependency (#20550)
dg0yt Oct 6, 2021
0839cb2
[OpenMVS] restore deprecated cmake scripts for configure, build & fix…
cenit Oct 7, 2021
244402c
[libffi] Don't replace string in file that doesn't exist. (#20554)
larshg Oct 7, 2021
3944561
[json-dto] Update to 0.2.14 (#20570)
eao197 Oct 7, 2021
d2b28a4
[sail] Update to 0.9.0-pre17 (#20562)
Oct 7, 2021
4e2fc1a
[freexl] Update to 1.0.6 (#20520)
dg0yt Oct 7, 2021
1e01203
[dartsim] Update to 6.11.0 (#20566)
Ace314159 Oct 7, 2021
b2b85c4
[scripts/boost] update Boost version in boost-modular-build.cmake to …
yurybura Oct 7, 2021
b40a028
update version
yurybura Oct 7, 2021
799b851
Merge branch 'master' of https://github.com/microsoft/vcpkg into boos…
yurybura Oct 7, 2021
2fe0f0b
[boost-modular-build-helper] fix USER_CONFIG_EXTRA_LINES variable nam…
yurybura Oct 9, 2021
43f23f9
update version
yurybura Oct 9, 2021
9d02f35
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal Oct 11, 2021
d682882
Resolve differences from rerunning generate-ports.ps1.
BillyONeal Oct 11, 2021
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
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"
]
}
}
}
96 changes: 62 additions & 34 deletions ports/boost-modular-build-helper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
cmake_minimum_required(VERSION 3.9)
project(boost CXX)

set(B2_OPTIONS)
set(USER_CONFIG_TOOLSET)
set(USER_CONFIG_TOOLSET_VERSION)
set(USER_CONFIG_TOOLSET_INVOCATION_COMMAND)
set(USER_CONFIG_TOOLSET_OPTIONS)
set(USER_CONFIG_LINES)
yurybura marked this conversation as resolved.
Show resolved Hide resolved

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 +20,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 +50,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 +113,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 +181,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,6 +224,12 @@ 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}")
Expand All @@ -205,15 +238,9 @@ 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()

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 +262,7 @@ add_custom_target(boost ALL
--hash
-q
debug-symbols=on
# Enable debugging level 2.
-d +2

threading=multi
Expand Down
37 changes: 6 additions & 31 deletions ports/boost-modular-build-helper/user-config.jam
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
import toolset ;

if "@VCPKG_PLATFORM_TOOLSET@" != "external"
{
using msvc : @BOOST_MSVC_VERSION@ : cl.exe
:
<setup>"@NOTHING_BAT@"
@CXXFLAGS@
@CFLAGS@
@LDFLAGS@
;
}
else
{
using @B2_TOOLSET@ : : @CMAKE_CXX_COMPILER@
:
<ranlib>@CMAKE_RANLIB@
<archiver>@CMAKE_AR@
@CXXFLAGS@
@CFLAGS@
@LDFLAGS@
# MINGW here causes b2 to not run cygpath
<flavor>mingw
;
}
using @USER_CONFIG_TOOLSET@ : @USER_CONFIG_TOOLSET_VERSION@ : @USER_CONFIG_TOOLSET_INVOCATION_COMMAND@
:
@USER_CONFIG_TOOLSET_OPTIONS@
;

if "@PORT@" = "boost-python"
{
using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_RELEASE@" ;
using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_DEBUG@" : <python-debugging>on ;
using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_RELEASE@" ;
using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_DEBUG@" : <python-debugging>on ;
}
@USER_CONFIG_EXTRA_LINES@

if "@PORT@" = "boost-mpi" || "@PORT@" = "boost-graph-parallel"
{
Expand All @@ -42,7 +17,7 @@ if "@PORT@" = "boost-mpi" || "@PORT@" = "boost-graph-parallel"

project user-config : ;

if "@VCPKG_PLATFORM_TOOLSET@" != "external"
if "@USER_CONFIG_TOOLSET@" = "msvc"
{
lib advapi32 ;

Expand Down
1 change: 1 addition & 0 deletions ports/boost-modular-build-helper/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "boost-modular-build-helper",
"version": "1.77.0",
"port-version": 1,
"description": "Internal vcpkg port used to build Boost libraries",
"dependencies": [
"boost-uninstall"
Expand Down
Loading