From cb8a9fe7157f8ad2423742f893955ed9ced05910 Mon Sep 17 00:00:00 2001 From: Todor Prokopov Date: Fri, 5 Jun 2020 22:28:42 +0300 Subject: [PATCH] [boost] MinGW build fixes (#11427) --- ports/boost-build/CONTROL | 2 +- ports/boost-build/portfile.cmake | 9 +++++++-- ports/boost-modular-build-helper/CMakeLists.txt | 2 +- ports/boost-modular-build-helper/CONTROL | 2 +- .../boost-modular-build-helper/boost-modular-build.cmake | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index ddeebcd1362628..087970deab9dc7 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,4 +1,4 @@ Source: boost-build -Version: 1.73.0 +Version: 1.73.0-1 Homepage: https://github.com/boostorg/build Description: Boost.Build diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index 5823afc4e71041..7633f51aaa1fbf 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -4,7 +4,7 @@ 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") +elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") return() endif() @@ -52,8 +52,13 @@ file(WRITE "${CURRENT_PACKAGES_DIR}/tools/boost-build/src/tools/msvc.jam" "${_co message(STATUS "Bootstrapping...") if(CMAKE_HOST_WIN32) + if(VCPKG_TARGET_IS_MINGW) + set(TOOLSET mingw) + else() + set(TOOLSET msvc) + endif() vcpkg_execute_required_process( - COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" msvc + COMMAND "${CURRENT_PACKAGES_DIR}/tools/boost-build/bootstrap.bat" ${TOOLSET} WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boost-build LOGNAME bootstrap-${TARGET_TRIPLET} ) diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index ef33db8823a902..05a1762a037b99 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -83,7 +83,7 @@ if(NOT LDLAGS STREQUAL "") endif() #set(CXXFLAGS "${CXXFLAGS} -Wno-error=unused-command-line-argument") -if(CMAKE_CXX_COMPILER_TARGET) +if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET}${CMAKE_CXX_COMPILER_TARGET}") else() diff --git a/ports/boost-modular-build-helper/CONTROL b/ports/boost-modular-build-helper/CONTROL index 92652408549a3d..79cc74ccdb7295 100644 --- a/ports/boost-modular-build-helper/CONTROL +++ b/ports/boost-modular-build-helper/CONTROL @@ -1,2 +1,2 @@ Source: boost-modular-build-helper -Version: 1.73.0 +Version: 1.73.0-1 diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index d166a35ca41f08..a70363ee435931 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -19,7 +19,7 @@ function(boost_modular_build) # Todo: this serves too similar a purpose as vcpkg_find_acquire_program() if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build") - elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") 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)