From a773c59f05ddfbe3fd68517ed4c91aa179e57f89 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:01:33 -0700 Subject: [PATCH] [boost-build] Split out into boost-modular-build-helper and support non-Windows targets --- ports/boost-atomic/CONTROL | 2 +- ports/boost-build/CONTROL | 2 +- ports/boost-build/portfile.cmake | 45 ++++--- ports/boost-chrono/CONTROL | 2 +- ports/boost-container/CONTROL | 2 +- ports/boost-context/CONTROL | 2 +- ports/boost-coroutine/CONTROL | 2 +- ports/boost-date-time/CONTROL | 2 +- ports/boost-exception/CONTROL | 2 +- ports/boost-fiber/CONTROL | 2 +- ports/boost-filesystem/CONTROL | 2 +- ports/boost-graph-parallel/CONTROL | 2 +- ports/boost-graph/CONTROL | 2 +- ports/boost-iostreams/CONTROL | 2 +- ports/boost-locale/CONTROL | 2 +- ports/boost-log/CONTROL | 2 +- ports/boost-math/CONTROL | 2 +- .../boost-modular-build-helper/CMakeLists.txt | 120 ++++++++++++++++++ ports/boost-modular-build-helper/CONTROL | 2 + .../Jamroot.jam | 44 +++---- .../boost-modular-build.cmake | 94 +++++++++++--- .../nothing.bat | 0 .../boost-modular-build-helper/portfile.cmake | 11 ++ .../user-config.jam | 22 +++- ports/boost-mpi/CONTROL | 2 +- ports/boost-program-options/CONTROL | 2 +- ports/boost-random/CONTROL | 2 +- ports/boost-regex/CONTROL | 2 +- ports/boost-serialization/CONTROL | 2 +- ports/boost-signals/CONTROL | 2 +- ports/boost-stacktrace/CONTROL | 2 +- ports/boost-system/CONTROL | 2 +- ports/boost-test/CONTROL | 2 +- ports/boost-thread/CONTROL | 2 +- ports/boost-timer/CONTROL | 2 +- ports/boost-type-erasure/CONTROL | 2 +- ports/boost-vcpkg-helpers/generate-ports.ps1 | 2 +- ports/boost-wave/CONTROL | 2 +- 38 files changed, 299 insertions(+), 99 deletions(-) create mode 100644 ports/boost-modular-build-helper/CMakeLists.txt create mode 100644 ports/boost-modular-build-helper/CONTROL rename ports/{boost-build => boost-modular-build-helper}/Jamroot.jam (55%) rename ports/{boost-build => boost-modular-build-helper}/boost-modular-build.cmake (77%) rename ports/{boost-build => boost-modular-build-helper}/nothing.bat (100%) create mode 100644 ports/boost-modular-build-helper/portfile.cmake rename ports/{boost-build => boost-modular-build-helper}/user-config.jam (71%) diff --git a/ports/boost-atomic/CONTROL b/ports/boost-atomic/CONTROL index 9c84408ebb..4a625b6df7 100644 --- a/ports/boost-atomic/CONTROL +++ b/ports/boost-atomic/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-atomic Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-integer, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-integer, boost-type-traits, boost-vcpkg-helpers Description: Boost atomic module diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index cf93bfa1ec..ef59d386c8 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,3 +1,3 @@ Source: boost-build -Version: 1.66.0-5 +Version: 1.66.0-8 Description: Boost.Build diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index ea2b572619..fdd559ebef 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -4,12 +4,10 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") return() +elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + return() endif() -# This fixes the lib path to use desktop libs instead of uwp -- TODO: improve this with better "host" compilation -string(REPLACE "\\store\\;" "\\;" LIB "$ENV{LIB}") -set(ENV{LIB} "${LIB}") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO boostorg/build @@ -30,6 +28,13 @@ vcpkg_download_distfile(BOOSTCPP_ARCHIVE SHA512 ef2ae1d6a53a7f93654950e2e8e679da6b0359f02baafc03db970801634c1f5d4229633b5b6d74ad96a306e6efe3429d436669dc165b1fa655917e0ec74714e4 ) +file(INSTALL ${ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build RENAME copyright) +file(INSTALL ${BOOSTCPP_ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/boost-build RENAME boostcpp.jam) + +# This fixes the lib path to use desktop libs instead of uwp -- TODO: improve this with better "host" compilation +string(REPLACE "\\store\\;" "\\;" LIB "$ENV{LIB}") +set(ENV{LIB} "${LIB}") + file(COPY ${SOURCE_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/tools/boost-build @@ -44,22 +49,16 @@ string(REPLACE "_WIN32_WINNT=0x0602" "" _contents "${_contents}") file(WRITE "${CURRENT_PACKAGES_DIR}/tools/boost-build/src/tools/msvc.jam" "${_contents}") message(STATUS "Bootstrapping...") -vcpkg_execute_required_process( - COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" msvc - WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boost-build - LOGNAME bootstrap-${TARGET_TRIPLET} -) - -file(INSTALL ${ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build RENAME copyright) -file(INSTALL ${BOOSTCPP_ARCHIVE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/boost-build RENAME boostcpp.jam) - - - -file( - COPY - ${CMAKE_CURRENT_LIST_DIR}/boost-modular-build.cmake - ${CMAKE_CURRENT_LIST_DIR}/Jamroot.jam - ${CMAKE_CURRENT_LIST_DIR}/nothing.bat - ${CMAKE_CURRENT_LIST_DIR}/user-config.jam - DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build -) +if(CMAKE_HOST_WIN32) + vcpkg_execute_required_process( + COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" msvc + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boost-build + LOGNAME bootstrap-${TARGET_TRIPLET} + ) +else() + vcpkg_execute_required_process( + COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.sh" + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boost-build + LOGNAME bootstrap-${TARGET_TRIPLET} + ) +endif() diff --git a/ports/boost-chrono/CONTROL b/ports/boost-chrono/CONTROL index 00ee988717..b5fb892cd9 100644 --- a/ports/boost-chrono/CONTROL +++ b/ports/boost-chrono/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-chrono Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-move, boost-mpl, boost-predef, boost-ratio, boost-static-assert, boost-system, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-detail, boost-integer, boost-move, boost-mpl, boost-predef, boost-ratio, boost-static-assert, boost-system, boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Description: Boost chrono module diff --git a/ports/boost-container/CONTROL b/ports/boost-container/CONTROL index df2cfe44e2..69e641d369 100644 --- a/ports/boost-container/CONTROL +++ b/ports/boost-container/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-container Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-functional, boost-integer, boost-intrusive, boost-move, boost-static-assert, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-functional, boost-integer, boost-intrusive, boost-move, boost-static-assert, boost-type-traits, boost-vcpkg-helpers Description: Boost container module diff --git a/ports/boost-context/CONTROL b/ports/boost-context/CONTROL index 37568a50d5..22295dddc5 100644 --- a/ports/boost-context/CONTROL +++ b/ports/boost-context/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-context Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-pool, boost-predef, boost-smart-ptr, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-detail, boost-integer, boost-pool, boost-predef, boost-smart-ptr, boost-vcpkg-helpers Description: Boost context module diff --git a/ports/boost-coroutine/CONTROL b/ports/boost-coroutine/CONTROL index 227ffe8efe..77683890a6 100644 --- a/ports/boost-coroutine/CONTROL +++ b/ports/boost-coroutine/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-coroutine Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-context (windows), boost-detail, boost-exception, boost-integer, boost-move, boost-range, boost-system, boost-thread (windows), boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-context (windows), boost-detail, boost-exception, boost-integer, boost-move, boost-range, boost-system, boost-thread (windows), boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost coroutine module diff --git a/ports/boost-date-time/CONTROL b/ports/boost-date-time/CONTROL index 73f8d07cec..8e8738e8d8 100644 --- a/ports/boost-date-time/CONTROL +++ b/ports/boost-date-time/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-date-time Version: 1.66.0 -Build-Depends: boost-algorithm, boost-assert, boost-build, boost-compatibility, boost-config, boost-detail, boost-integer, boost-io, boost-lexical-cast, boost-math, boost-mpl, boost-range, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi +Build-Depends: boost-algorithm, boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-detail, boost-integer, boost-io, boost-lexical-cast, boost-math, boost-mpl, boost-range, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Description: Boost date_time module diff --git a/ports/boost-exception/CONTROL b/ports/boost-exception/CONTROL index 52d316c342..476c53cf4b 100644 --- a/ports/boost-exception/CONTROL +++ b/ports/boost-exception/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-exception Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-smart-ptr, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-smart-ptr, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost exception module diff --git a/ports/boost-fiber/CONTROL b/ports/boost-fiber/CONTROL index 776d929a3f..b02c94a3b1 100644 --- a/ports/boost-fiber/CONTROL +++ b/ports/boost-fiber/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-fiber Version: 1.66.0 -Build-Depends: boost-algorithm, boost-assert, boost-build, boost-config, boost-context (windows), boost-core, boost-detail, boost-filesystem (windows), boost-format, boost-intrusive, boost-predef, boost-smart-ptr, boost-vcpkg-helpers +Build-Depends: boost-algorithm, boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-context (windows), boost-core, boost-detail, boost-filesystem (windows), boost-format, boost-intrusive, boost-predef, boost-smart-ptr, boost-vcpkg-helpers Description: Boost fiber module diff --git a/ports/boost-filesystem/CONTROL b/ports/boost-filesystem/CONTROL index afa6d0e455..4717d608be 100644 --- a/ports/boost-filesystem/CONTROL +++ b/ports/boost-filesystem/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-filesystem Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-functional, boost-integer, boost-io, boost-iterator, boost-range, boost-smart-ptr, boost-static-assert, boost-system, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-detail, boost-functional, boost-integer, boost-io, boost-iterator, boost-range, boost-smart-ptr, boost-static-assert, boost-system, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost filesystem module diff --git a/ports/boost-graph-parallel/CONTROL b/ports/boost-graph-parallel/CONTROL index ba7cf38d29..3f1e8e1ed8 100644 --- a/ports/boost-graph-parallel/CONTROL +++ b/ports/boost-graph-parallel/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph-parallel Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-detail, boost-dynamic-bitset, boost-function, boost-functional, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-detail, boost-dynamic-bitset, boost-function, boost-functional, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Description: Boost graph_parallel module diff --git a/ports/boost-graph/CONTROL b/ports/boost-graph/CONTROL index dc81d1a851..12d74bc1ed 100644 --- a/ports/boost-graph/CONTROL +++ b/ports/boost-graph/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph Version: 1.66.0 -Build-Depends: boost-algorithm, boost-any, boost-array, boost-assert, boost-bimap, boost-bind, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-functional, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-move, boost-mpl, boost-multi-index, boost-optional, boost-parameter, boost-preprocessor, boost-property-map, boost-property-tree, boost-random, boost-range, boost-regex, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-test (windows), boost-throw-exception, boost-tti, boost-tuple, boost-typeof, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers, boost-xpressive +Build-Depends: boost-algorithm, boost-any, boost-array, boost-assert, boost-bimap, boost-bind, boost-build, boost-modular-build-helper, boost-compatibility, boost-concept-check, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-functional, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-move, boost-mpl, boost-multi-index, boost-optional, boost-parameter, boost-preprocessor, boost-property-map, boost-property-tree, boost-random, boost-range, boost-regex, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-test (windows), boost-throw-exception, boost-tti, boost-tuple, boost-typeof, boost-type-traits, boost-unordered, boost-utility, boost-vcpkg-helpers, boost-xpressive Description: Boost graph module diff --git a/ports/boost-iostreams/CONTROL b/ports/boost-iostreams/CONTROL index 57301cb189..d48fdfd24c 100644 --- a/ports/boost-iostreams/CONTROL +++ b/ports/boost-iostreams/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-iostreams Version: 1.66.0 -Build-Depends: boost-assert, boost-bind, boost-build, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-mpl, boost-preprocessor, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, bzip2, zlib +Build-Depends: boost-assert, boost-bind, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-mpl, boost-preprocessor, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, bzip2, zlib Description: Boost iostreams module diff --git a/ports/boost-locale/CONTROL b/ports/boost-locale/CONTROL index 884c737b4e..0a37505b19 100644 --- a/ports/boost-locale/CONTROL +++ b/ports/boost-locale/CONTROL @@ -1,7 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-locale Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-function, boost-integer, boost-iterator, boost-smart-ptr, boost-static-assert, boost-thread (windows), boost-type-traits, boost-unordered, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-function, boost-integer, boost-iterator, boost-smart-ptr, boost-static-assert, boost-thread (windows), boost-type-traits, boost-unordered, boost-vcpkg-helpers Description: Boost locale module Feature: icu diff --git a/ports/boost-log/CONTROL b/ports/boost-log/CONTROL index 912f771d0f..e8ac68f444 100644 --- a/ports/boost-log/CONTROL +++ b/ports/boost-log/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-log Version: 1.66.0 -Build-Depends: boost-align, boost-array, boost-asio, boost-assert, boost-atomic, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-date-time, boost-detail, boost-exception, boost-filesystem (windows), boost-function-types, boost-fusion, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iterator, boost-lexical-cast, boost-locale (windows), boost-math, boost-move, boost-mpl, boost-optional, boost-parameter, boost-phoenix, boost-predef, boost-preprocessor, boost-property-tree, boost-proto, boost-random, boost-range, boost-regex, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-thread (windows), boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi, boost-xpressive +Build-Depends: boost-align, boost-array, boost-asio, boost-assert, boost-atomic, boost-bind, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-date-time, boost-detail, boost-exception, boost-filesystem (windows), boost-function-types, boost-fusion, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iterator, boost-lexical-cast, boost-locale (windows), boost-math, boost-move, boost-mpl, boost-optional, boost-parameter, boost-phoenix, boost-predef, boost-preprocessor, boost-property-tree, boost-proto, boost-random, boost-range, boost-regex, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-thread (windows), boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi, boost-xpressive Description: Boost log module diff --git a/ports/boost-math/CONTROL b/ports/boost-math/CONTROL index 8343ab9854..33b230a22a 100644 --- a/ports/boost-math/CONTROL +++ b/ports/boost-math/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-math Version: 1.66.0 -Build-Depends: boost-array, boost-assert, boost-atomic, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-fusion, boost-integer, boost-lambda, boost-lexical-cast, boost-mpl, boost-predef, boost-range, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-array, boost-assert, boost-atomic, boost-build, boost-modular-build-helper, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-fusion, boost-integer, boost-lambda, boost-lexical-cast, boost-mpl, boost-predef, boost-range, boost-static-assert, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost math module diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt new file mode 100644 index 0000000000..20306e7ed9 --- /dev/null +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -0,0 +1,120 @@ +cmake_minimum_required(VERSION 3.9) +project(boost CXX) + +find_path(ZLIB_INCLUDE zlib.h) +find_path(BZIP2_INCLUDE bzlib.h) +find_path(ICU_PATH include/unicode/utf.h) + +set(VCPKG_PLATFORM_TOOLSET external) + +set(B2_OPTIONS) + +# Add build type specific options +if(BUILD_SHARED_LIBS) + 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) + list(APPEND B2_OPTIONS link=shared) +else() + list(APPEND B2_OPTIONS link=static) +endif() + +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64") + list(APPEND B2_OPTIONS address-model=64) +endif() + +list(APPEND B2_OPTIONS target-os=linux toolset=gcc) + +string(REPLACE " " " " CXXFLAGS "${CMAKE_CXX_FLAGS}") +#set(CXXFLAGS "${CXXFLAGS} -Wno-error=unused-command-line-argument") +if(CMAKE_CXX_COMPILER_TARGET) + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET} ${CMAKE_CXX_COMPILER_TARGET}") +endif() +if(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") +endif() +if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT) + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") +endif() +foreach(INCDIR ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES}) + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_INCLUDE_FLAG_C}${CMAKE_INCLUDE_FLAG_C_SEP}${INCDIR}") +endforeach() + +find_library(ZLIB_LIBPATH z) +list(APPEND B2_OPTIONS + -sZLIB_BINARY=z + -sZLIB_LIBPATH="${ZLIB_LIBPATH}" +) +if(CMAKE_BUILD_TYPE STREQUAL "Release") + find_library(BZIP2_LIBPATH bz2) + list(APPEND B2_OPTIONS + -sBZIP2_BINARY=bz2 + -sBZIP2_LIBPATH="${BZIP2_LIBPATH}" + variant=release + ) +elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + find_library(BZIP2_LIBPATH bz2d) + list(APPEND B2_OPTIONS + -sBZIP2_BINARY=bz2d + -sBZIP2_LIBPATH="${BZIP2_LIBPATH}" + variant=debug + ) +endif() + +configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY) + +set(NUMBER_OF_PROCESSORS 1) +if(DEFINED ENV{NUMBER_OF_PROCESSORS}) + set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS}) +elseif(CMAKE_HOST_LINUX) + execute_process( + COMMAND nproc + OUTPUT_VARIABLE NUMBER_OF_PROCESSORS + ) + string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") + string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") +endif() +if(NOT NUMBER_OF_PROCESSORS) + set(NUMBER_OF_PROCESSORS 1) +endif() + +add_custom_target(boost ALL + COMMAND "${B2_EXE}" + --user-config=${CMAKE_CURRENT_BINARY_DIR}/user-config.jam + --stagedir=${CMAKE_CURRENT_BINARY_DIR}/stage + --build-dir=${CMAKE_CURRENT_BINARY_DIR} + ${B2_OPTIONS} + --layout=system + --with-atomic + --with-random + --with-date_time + --with-filesystem + --with-system + --with-thread + --with-chrono + -sZLIB_INCLUDE="${ZLIB_INCLUDE}" + -sBZIP2_INCLUDE="${BZIP2_INCLUDE}" + -sICU_PATH="${ICU_PATH}" + -j${NUMBER_OF_PROCESSORS} + -sBOOST_ROOT=${BOOST_BUILD_PATH} + -sBOOST_BUILD_PATH=${BOOST_BUILD_PATH} + --debug-configuration + --ignore-site-config + --hash + -q + + architecture=x86 + threading=multi + threadapi=pthread + debug-symbols=on + WORKING_DIRECTORY ${SOURCE_PATH} +) + +install( + CODE "file(GLOB LIBS ${CMAKE_CURRENT_BINARY_DIR}/boost/build/*/*.a)\nif(LIBS)\nfile(INSTALL \${LIBS} DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib\")\nendif()" +) diff --git a/ports/boost-modular-build-helper/CONTROL b/ports/boost-modular-build-helper/CONTROL new file mode 100644 index 0000000000..eb2257a017 --- /dev/null +++ b/ports/boost-modular-build-helper/CONTROL @@ -0,0 +1,2 @@ +Source: boost-modular-build-helper +Version: 1 diff --git a/ports/boost-build/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam similarity index 55% rename from ports/boost-build/Jamroot.jam rename to ports/boost-modular-build-helper/Jamroot.jam index 6669b446ed..e498483c35 100644 --- a/ports/boost-build/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam @@ -36,8 +36,8 @@ if "@PORT@" != "boost-system" { use-project /boost/system : . ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/lib/boost_system-vc140-mt.lib" release ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_system-vc140-mt-gd.lib" debug ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_system ; } @@ -45,8 +45,8 @@ if "@PORT@" != "boost-chrono" { use-project /boost/chrono : . ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/lib/boost_chrono-vc140-mt.lib" release ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_chrono-vc140-mt-gd.lib" debug ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_chrono ; } @@ -54,8 +54,8 @@ if "@PORT@" != "boost-regex" { use-project /boost/regex : . ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/lib/boost_regex-vc140-mt.lib" release ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_regex-vc140-mt-gd.lib" debug ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_regex ; } @@ -63,8 +63,8 @@ if "@PORT@" != "boost-date-time" { use-project /boost/date_time : . ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/lib/boost_date_time-vc140-mt.lib" release -/boost/date_time//boost_date_time ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_date_time-vc140-mt-gd.lib" debug -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_RELEASE_SUFFIX@" release -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_DEBUG_SUFFIX@" debug -/boost/date_time//boost_date_time ; explicit boost_date_time ; } @@ -72,8 +72,8 @@ if "@PORT@" != "boost-thread" { use-project /boost/thread : . ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/lib/boost_thread-vc140-mt.lib" release : : /boost/date_time//boost_date_time ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_thread-vc140-mt-gd.lib" debug : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/date_time//boost_date_time ; explicit boost_thread ; } @@ -81,8 +81,8 @@ if "@PORT@" != "boost-timer" { use-project /boost/timer : . ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/lib/boost_timer-vc140-mt.lib" release ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_timer-vc140-mt-gd.lib" debug ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_timer ; } @@ -90,8 +90,8 @@ if "@PORT@" != "boost-filesystem" { use-project /boost/filesystem : . ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/lib/boost_filesystem-vc140-mt.lib" release : : /boost/system//boost_system ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_filesystem-vc140-mt-gd.lib" debug : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/system//boost_system ; explicit boost_filesystem ; } @@ -99,8 +99,8 @@ if "@PORT@" != "boost-atomic" { use-project /boost/atomic : . ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/lib/boost_atomic-vc140-mt.lib" release ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_atomic-vc140-mt-gd.lib" debug ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_atomic ; } @@ -111,8 +111,8 @@ if "@PORT@" != "boost-context" use-project /boost/context : . ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/lib/boost_context-vc140-mt.lib" release ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_context-vc140-mt-gd.lib" debug ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_context ; } @@ -120,8 +120,8 @@ if "@PORT@" != "boost-test" { use-project /boost/test : . ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/lib/boost_unit_test_framework-vc140-mt.lib" release ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/debug/lib/boost_unit_test_framework-vc140-mt-gd.lib" debug ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_unit_test_framework ; } @@ -129,8 +129,8 @@ if "@PORT@" != "boost-serialization" { use-project /boost/serialization : . ; - lib boost_serialization : : @CURRENT_INSTALLED_DIR@/lib/boost_serialization-vc140-mt.lib release ; - lib boost_serialization : : @CURRENT_INSTALLED_DIR@/debug/lib/boost_serialization-vc140-mt-gd.lib debug ; + lib boost_serialization : : @CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_RELEASE_SUFFIX@ release ; + lib boost_serialization : : @CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_DEBUG_SUFFIX@ debug ; explicit boost_serialization ; } diff --git a/ports/boost-build/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake similarity index 77% rename from ports/boost-build/boost-modular-build.cmake rename to ports/boost-modular-build-helper/boost-modular-build.cmake index 57505dbea2..557e089dd2 100644 --- a/ports/boost-build/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -6,16 +6,26 @@ function(boost_modular_build) endif() # Todo: this serves too similar a purpose as vcpkg_find_acquire_program() - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/tools/boost-build") - else() + if(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) + elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) + else() + set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/tools/boost-build") endif() if(NOT EXISTS "${BOOST_BUILD_PATH}") message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.") endif() + if(EXISTS "${BOOST_BUILD_PATH}/b2.exe") + set(B2_EXE "${BOOST_BUILD_PATH}/b2.exe") + elseif(EXISTS "${BOOST_BUILD_PATH}/b2") + set(B2_EXE "${BOOST_BUILD_PATH}/b2") + else() + message(FATAL_ERROR "Could not find b2 in ${BOOST_BUILD_PATH}") + endif() + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") list(APPEND _bm_OPTIONS windows-api=store) endif() @@ -28,7 +38,15 @@ function(boost_modular_build) set(REQUIREMENTS ${_bm_REQUIREMENTS}) - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) + if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(BOOST_LIB_PREFIX) + set(BOOST_LIB_RELEASE_SUFFIX -vc140-mt.lib) + set(BOOST_LIB_DEBUG_SUFFIX -vc140-mt-gd.lib) + else() + set(BOOST_LIB_PREFIX lib) + set(BOOST_LIB_RELEASE_SUFFIX .a) + set(BOOST_LIB_DEBUG_SUFFIX .a) + endif() # boost thread superfluously builds has_atomic_flag_lockfree on windows. if(EXISTS "${_bm_SOURCE_PATH}/build/Jamfile.v2") @@ -59,6 +77,21 @@ function(boost_modular_build) file(WRITE ${_bm_SOURCE_PATH}/build/log-architecture.jam "${_contents}") endif() + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) + + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + vcpkg_configure_cmake( + SOURCE_PATH ${CURRENT_INSTALLED_DIR}/share/boost-build + PREFER_NINJA + OPTIONS + "-DB2_EXE=${B2_EXE}" + "-DSOURCE_PATH=${_bm_SOURCE_PATH}" + "-DBOOST_BUILD_PATH=${BOOST_BUILD_PATH}" + ) + vcpkg_install_cmake() + return() + endif() + ##################### # Cleanup previous builds ###################### @@ -90,11 +123,22 @@ function(boost_modular_build) ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ) + if(DEFINED ENV{NUMBER_OF_PROCESSORS}) + set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS}) + else() + execute_process( + COMMAND nproc + OUTPUT_VARIABLE NUMBER_OF_PROCESSORS + ) + string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") + string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}") + endif() + ###################### # Generate configuration ###################### list(APPEND _bm_OPTIONS - -j$ENV{NUMBER_OF_PROCESSORS} + -j${NUMBER_OF_PROCESSORS} --debug-configuration --debug-building --debug-generators @@ -102,23 +146,27 @@ function(boost_modular_build) --ignore-site-config --hash -q - -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - threadapi=win32 + -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include" + -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include" threading=multi ) + if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + list(APPEND _bm_OPTIONS threadapi=win32) + else() + list(APPEND _bm_OPTIONS threadapi=pthread) + endif() set(_bm_OPTIONS_DBG -sZLIB_BINARY=zlibd - -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" + -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib" -sBZIP2_BINARY=bz2d - -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib" ) set(_bm_OPTIONS_REL -sZLIB_BINARY=zlib - -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" + -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}/lib" -sBZIP2_BINARY=bz2 - -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}/lib" ) @@ -173,6 +221,8 @@ function(boost_modular_build) list(APPEND _bm_OPTIONS toolset=msvc-14.1) elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") list(APPEND _bm_OPTIONS toolset=msvc-14.0) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "external") + list(APPEND _bm_OPTIONS toolset=gcc) else() message(FATAL_ERROR "Unsupported value for VCPKG_PLATFORM_TOOLSET: '${VCPKG_PLATFORM_TOOLSET}'") endif() @@ -180,8 +230,6 @@ function(boost_modular_build) ###################### # Perform build + Package ###################### - set(B2_EXE "${BOOST_BUILD_PATH}/b2.exe") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${TARGET_TRIPLET}-rel") set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") @@ -219,10 +267,13 @@ function(boost_modular_build) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Packaging ${TARGET_TRIPLET}-rel") - file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/*.lib) + file(GLOB REL_LIBS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/*.lib + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/*.a + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/*.so + ) file(COPY ${REL_LIBS} - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - FILES_MATCHING PATTERN "*.lib") + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/boost/build/*/*.dll) file(COPY ${REL_DLLS} @@ -234,10 +285,13 @@ function(boost_modular_build) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Packaging ${TARGET_TRIPLET}-dbg") - file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/*.lib) + file(GLOB DBG_LIBS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/*.lib + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/*.a + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/*.so + ) file(COPY ${DBG_LIBS} - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - FILES_MATCHING PATTERN "*.lib") + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/boost/build/*/*.dll) file(COPY ${DBG_DLLS} diff --git a/ports/boost-build/nothing.bat b/ports/boost-modular-build-helper/nothing.bat similarity index 100% rename from ports/boost-build/nothing.bat rename to ports/boost-modular-build-helper/nothing.bat diff --git a/ports/boost-modular-build-helper/portfile.cmake b/ports/boost-modular-build-helper/portfile.cmake new file mode 100644 index 0000000000..1c34f2fec4 --- /dev/null +++ b/ports/boost-modular-build-helper/portfile.cmake @@ -0,0 +1,11 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +file( + COPY + ${CMAKE_CURRENT_LIST_DIR}/boost-modular-build.cmake + ${CMAKE_CURRENT_LIST_DIR}/Jamroot.jam + ${CMAKE_CURRENT_LIST_DIR}/nothing.bat + ${CMAKE_CURRENT_LIST_DIR}/user-config.jam + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build +) diff --git a/ports/boost-build/user-config.jam b/ports/boost-modular-build-helper/user-config.jam similarity index 71% rename from ports/boost-build/user-config.jam rename to ports/boost-modular-build-helper/user-config.jam index 59cc160cc1..e045d622ba 100644 --- a/ports/boost-build/user-config.jam +++ b/ports/boost-modular-build-helper/user-config.jam @@ -1,9 +1,23 @@ import toolset ; -using msvc : : cl.exe : -"@NOTHING_BAT@" -@TOOLSET_OPTIONS@ -; +if "@VCPKG_PLATFORM_TOOLSET@" != "external" +{ + using msvc : : cl.exe : + "@NOTHING_BAT@" + @TOOLSET_OPTIONS@ + ; +} +else +{ + using gcc : 5.4.1 : @CMAKE_CXX_COMPILER@ + : + @CMAKE_RANLIB@ + @CMAKE_AR@ + @CXXFLAGS@ + # MINGW here causes b2 to not run cygpath + mingw + ; +} if "@PORT@" = "boost-python" { diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index 7d17fedecd..30ce81a1d6 100644 --- a/ports/boost-mpi/CONTROL +++ b/ports/boost-mpi/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpi Version: 1.66.0-1 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-python (windows), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, msmpi +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-python (windows), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, msmpi Description: Boost mpi module diff --git a/ports/boost-program-options/CONTROL b/ports/boost-program-options/CONTROL index 3a1ff727e0..b43937e554 100644 --- a/ports/boost-program-options/CONTROL +++ b/ports/boost-program-options/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-program-options Version: 1.66.0 -Build-Depends: boost-any, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-iterator, boost-lexical-cast, boost-math, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-any, boost-bind, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-iterator, boost-lexical-cast, boost-math, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-tokenizer, boost-type-traits, boost-vcpkg-helpers Description: Boost program_options module diff --git a/ports/boost-random/CONTROL b/ports/boost-random/CONTROL index fee15c8910..1efeeaafa6 100644 --- a/ports/boost-random/CONTROL +++ b/ports/boost-random/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-random Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-integer, boost-math, boost-mpl, boost-range, boost-static-assert, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-detail, boost-integer, boost-math, boost-mpl, boost-range, boost-static-assert, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost random module diff --git a/ports/boost-regex/CONTROL b/ports/boost-regex/CONTROL index 24e5014d4c..efd3e7f7e0 100644 --- a/ports/boost-regex/CONTROL +++ b/ports/boost-regex/CONTROL @@ -1,7 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-regex Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-iterator, boost-mpl, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-concept-check, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-iterator, boost-mpl, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Description: Boost regex module Feature: icu diff --git a/ports/boost-serialization/CONTROL b/ports/boost-serialization/CONTROL index 146c618bda..ae97a8c30c 100644 --- a/ports/boost-serialization/CONTROL +++ b/ports/boost-serialization/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-serialization Version: 1.66.0 -Build-Depends: boost-array, boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-io, boost-iterator, boost-move, boost-mpl, boost-optional, boost-preprocessor, boost-smart-ptr, boost-spirit, boost-static-assert, boost-type-traits, boost-unordered, boost-utility, boost-variant, boost-vcpkg-helpers +Build-Depends: boost-array, boost-assert, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-io, boost-iterator, boost-move, boost-mpl, boost-optional, boost-preprocessor, boost-smart-ptr, boost-spirit, boost-static-assert, boost-type-traits, boost-unordered, boost-utility, boost-variant, boost-vcpkg-helpers Description: Boost serialization module diff --git a/ports/boost-signals/CONTROL b/ports/boost-signals/CONTROL index e612f34151..160f73c516 100644 --- a/ports/boost-signals/CONTROL +++ b/ports/boost-signals/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-signals Version: 1.66.0 -Build-Depends: boost-any, boost-build, boost-config, boost-core, boost-function, boost-iterator, boost-optional, boost-smart-ptr, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-any, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-function, boost-iterator, boost-optional, boost-smart-ptr, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost signals module diff --git a/ports/boost-stacktrace/CONTROL b/ports/boost-stacktrace/CONTROL index b6c11e8f3e..9979ef4e1a 100644 --- a/ports/boost-stacktrace/CONTROL +++ b/ports/boost-stacktrace/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-stacktrace Version: 1.66.0 -Build-Depends: boost-array, boost-build, boost-config, boost-core, boost-lexical-cast, boost-math, boost-static-assert, boost-type-traits, boost-vcpkg-helpers, boost-winapi +Build-Depends: boost-array, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-lexical-cast, boost-math, boost-static-assert, boost-type-traits, boost-vcpkg-helpers, boost-winapi Description: Boost stacktrace module diff --git a/ports/boost-system/CONTROL b/ports/boost-system/CONTROL index 92d43608fe..953782bfba 100644 --- a/ports/boost-system/CONTROL +++ b/ports/boost-system/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-system Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-integer, boost-predef, boost-utility, boost-vcpkg-helpers, boost-winapi +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-core, boost-integer, boost-predef, boost-utility, boost-vcpkg-helpers, boost-winapi Description: Boost system module diff --git a/ports/boost-test/CONTROL b/ports/boost-test/CONTROL index 52dac99e21..95b0d8fe98 100644 --- a/ports/boost-test/CONTROL +++ b/ports/boost-test/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-test Version: 1.66.0-2 -Build-Depends: boost-algorithm, boost-assert, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-io, boost-iterator, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-range, boost-smart-ptr, boost-static-assert, boost-timer, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-algorithm, boost-assert, boost-bind, boost-build, boost-modular-build-helper, boost-compatibility, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-io, boost-iterator, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-range, boost-smart-ptr, boost-static-assert, boost-timer, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost test module diff --git a/ports/boost-thread/CONTROL b/ports/boost-thread/CONTROL index 772f1a4502..33bc787a11 100644 --- a/ports/boost-thread/CONTROL +++ b/ports/boost-thread/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-thread Version: 1.66.0 -Build-Depends: boost-algorithm, boost-assert, boost-atomic, boost-bind, boost-build, boost-chrono, boost-concept-check, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-exception, boost-function, boost-functional, boost-integer, boost-intrusive, boost-io, boost-lexical-cast, boost-math, boost-move, boost-mpl, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-system, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi +Build-Depends: boost-algorithm, boost-assert, boost-atomic, boost-bind, boost-build, boost-modular-build-helper, boost-chrono, boost-concept-check, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-exception, boost-function, boost-functional, boost-integer, boost-intrusive, boost-io, boost-lexical-cast, boost-math, boost-move, boost-mpl, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-system, boost-throw-exception, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi Description: Boost thread module diff --git a/ports/boost-timer/CONTROL b/ports/boost-timer/CONTROL index be8b0c18a0..b24137fbb5 100644 --- a/ports/boost-timer/CONTROL +++ b/ports/boost-timer/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-timer Version: 1.66.0 -Build-Depends: boost-build, boost-chrono, boost-compatibility, boost-config, boost-core, boost-integer, boost-io, boost-system, boost-throw-exception, boost-vcpkg-helpers +Build-Depends: boost-build, boost-modular-build-helper, boost-chrono, boost-compatibility, boost-config, boost-core, boost-integer, boost-io, boost-system, boost-throw-exception, boost-vcpkg-helpers Description: Boost timer module diff --git a/ports/boost-type-erasure/CONTROL b/ports/boost-type-erasure/CONTROL index 79a8697a33..786acf5962 100644 --- a/ports/boost-type-erasure/CONTROL +++ b/ports/boost-type-erasure/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-type-erasure Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-fusion, boost-iterator, boost-mpl, boost-preprocessor, boost-smart-ptr, boost-thread (windows), boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-config, boost-detail, boost-fusion, boost-iterator, boost-mpl, boost-preprocessor, boost-smart-ptr, boost-thread (windows), boost-throw-exception, boost-typeof, boost-type-traits, boost-utility, boost-vcpkg-helpers Description: Boost type_erasure module diff --git a/ports/boost-vcpkg-helpers/generate-ports.ps1 b/ports/boost-vcpkg-helpers/generate-ports.ps1 index 8b79826e24..55fa476f41 100644 --- a/ports/boost-vcpkg-helpers/generate-ports.ps1 +++ b/ports/boost-vcpkg-helpers/generate-ports.ps1 @@ -322,7 +322,7 @@ foreach ($library in $libraries) $needsBuild = $false if ((Test-Path $unpacked/build/Jamfile.v2) -and $library -ne "metaparse") { - $deps += @("boost-build") + $deps += @("boost-build", "boost-modular-build-helper") $needsBuild = $true } diff --git a/ports/boost-wave/CONTROL b/ports/boost-wave/CONTROL index 99aa3d8bed..4fffc2e71c 100644 --- a/ports/boost-wave/CONTROL +++ b/ports/boost-wave/CONTROL @@ -1,5 +1,5 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-wave Version: 1.66.0 -Build-Depends: boost-assert, boost-build, boost-concept-check, boost-config, boost-core, boost-detail, boost-filesystem (windows), boost-integer, boost-iterator, boost-mpl, boost-multi-index, boost-pool, boost-preprocessor, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-build, boost-modular-build-helper, boost-concept-check, boost-config, boost-core, boost-detail, boost-filesystem (windows), boost-integer, boost-iterator, boost-mpl, boost-multi-index, boost-pool, boost-preprocessor, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Description: Boost wave module