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] fix clang-cl builds #26337

Closed
wants to merge 20 commits into from
Closed
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
10 changes: 6 additions & 4 deletions ports/boost-atomic/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ vcpkg_replace_string("${SOURCE_PATH}/build/Jamfile.v2"
"project.load [ path.join [ path.make $(here:D) ] ../config/checks/architecture ]"
)
file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/config")
include(${CURRENT_HOST_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)
boost_modular_build(SOURCE_PATH ${SOURCE_PATH})
include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake)
boost_modular_headers(SOURCE_PATH ${SOURCE_PATH})
include("${CURRENT_HOST_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake")
boost_modular_build(SOURCE_PATH "${SOURCE_PATH}")
include("${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake")
boost_modular_headers(SOURCE_PATH "${SOURCE_PATH}")

file(INSTALL "${SOURCE_PATH}/config/has_synchronization_lib.cpp" DESTINATION "${CURRENT_PACKAGES_DIR}/share/boost-atomic")
2 changes: 1 addition & 1 deletion ports/boost-atomic/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$comment": "When changing this file also update and run scripts/boost/generate-ports.ps1",
"name": "boost-atomic",
"version": "1.80.0",
"port-version": 1,
"port-version": 2,
"description": "Boost atomic module",
"homepage": "https://github.com/boostorg/atomic",
"license": "BSL-1.0",
Expand Down
4 changes: 2 additions & 2 deletions ports/boost-modular-build-helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if(CFLAGS MATCHES "-Zi" OR CXXFLAGS MATCHES "-Zi")
)
endif()

if(USER_CONFIG_TOOLSET STREQUAL "msvc")
if(USER_CONFIG_TOOLSET MATCHES "(msvc|clang-win)")
file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/nothing.bat" NOTHING_BAT)
string(APPEND USER_CONFIG_TOOLSET_OPTIONS
" <setup>\"${NOTHING_BAT}\"\n"
Expand All @@ -165,7 +165,7 @@ if(NOT LDFLAGS STREQUAL "")
string(APPEND USER_CONFIG_TOOLSET_OPTIONS " <linkflags>\"${LDFLAGS}\"\n")
endif()

if(WIN32 AND NOT USER_CONFIG_TOOLSET STREQUAL "msvc")
if(WIN32 AND NOT USER_CONFIG_TOOLSET MATCHES "(msvc|clang-win)")
# MINGW here causes b2 to not run cygpath
string(APPEND USER_CONFIG_TOOLSET_OPTIONS
" <flavor>mingw\n"
Expand Down
31 changes: 29 additions & 2 deletions ports/boost-modular-build-helper/Jamroot.jam.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ constant BOOST_JAMROOT_MODULE : $(__name__) ;

import boostcpp ;
import feature ;
import configure ;

boostcpp.set-version $(BOOST_VERSION) ;

Expand Down Expand Up @@ -100,10 +101,36 @@ if "@PORT@" != "boost-filesystem"

if "@PORT@" != "boost-atomic"
{
lib synchronization ;
explicit synchronization ;

exe has_synchronization_lib : @CURRENT_INSTALLED_DIR@/share/boost-atomic/has_synchronization_lib.cpp : <library>synchronization ;
explicit has_synchronization_lib ;

rule check-synchronization-lib ( properties * )
{
local result ;

if <target-os>windows in $(properties)
{
if [ configure.builds has_synchronization_lib : $(properties) : "has synchronization.lib" ]
{
result += <library>synchronization ;
}
else
{
result += <define>BOOST_ATOMIC_NO_SYNCHRONIZATION_LIB ;
}
}

return $(result) ;
}
use-project /boost/atomic : . ;

lib boost_atomic : : <file>"@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" <variant>release ;
lib boost_atomic : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" <variant>debug ;
lib boost_atomic : : <file>"@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" <variant>release : : usage-requirements
<conditional>@check-synchronization-lib ;
lib boost_atomic : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" <variant>debug : : usage-requirements
<conditional>@check-synchronization-lib ;
explicit boost_atomic ;
}

Expand Down
1 change: 1 addition & 0 deletions ports/boost-modular-build-helper/boost-modular-build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function(boost_modular_build)
string(REPLACE "-vc141-" "-vc140-" NEW_FILENAME ${NEW_FILENAME}) # To merge VS2017 and VS2015 binaries
string(REPLACE "-vc142-" "-vc140-" NEW_FILENAME ${NEW_FILENAME}) # To merge VS2019 and VS2015 binaries
string(REPLACE "-vc143-" "-vc140-" NEW_FILENAME ${NEW_FILENAME}) # To merge VS2022 and VS2015 binaries
string(REGEX REPLACE "-clangw14[0-9]-m(t|d)(-gy?)?" "" NEW_FILENAME "${NEW_FILENAME}")
string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs
string(REPLACE "-sgyd-" "-gyd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs
string(REPLACE "-gyd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs with python debugging
Expand Down
2 changes: 1 addition & 1 deletion ports/boost-modular-build-helper/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$comment": "When changing this file also update and run scripts/boost/generate-ports.ps1",
"name": "boost-modular-build-helper",
"version": "1.80.0",
"port-version": 3,
"port-version": 4,
"description": "Internal vcpkg port used to build Boost libraries",
"license": "MIT",
"dependencies": [
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-atomic.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cedb7729ed02d6631b8a1ceccd5ffabf69ee3932",
"version": "1.80.0",
"port-version": 2
},
{
"git-tree": "d5d96b1e0077d3b92de462eff308f45327774bb5",
"version": "1.80.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-modular-build-helper.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9fae8ffb1010988305db45fe71372175210eabec",
"version": "1.80.0",
"port-version": 4
},
{
"git-tree": "4a8c162e2661795b998a8435b6ec7207608fe73a",
"version": "1.80.0",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@
},
"boost-atomic": {
"baseline": "1.80.0",
"port-version": 1
"port-version": 2
},
"boost-beast": {
"baseline": "1.80.0",
Expand Down Expand Up @@ -862,7 +862,7 @@
},
"boost-modular-build-helper": {
"baseline": "1.80.0",
"port-version": 3
"port-version": 4
},
"boost-move": {
"baseline": "1.80.0",
Expand Down