Skip to content

Commit 78ff461

Browse files
Michael HerwigStephanTLavavej
andauthored
remove vcpkg in favor of boostorg/math standalone (#2151)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
1 parent 967479d commit 78ff461

15 files changed

+25
-94
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__/
99
/build/
1010
/out/
1111
/tools/out/
12+
/CMakeLists.txt.user

.gitmodules

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Copyright (c) Microsoft Corporation.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
[submodule "vcpkg"]
5-
path = vcpkg
6-
url = https://github.com/microsoft/vcpkg.git
7-
fetchRecurseSubmodules = false
84
[submodule "llvm-project"]
95
path = llvm-project
106
url = https://github.com/llvm/llvm-project.git
7+
[submodule "boost-math"]
8+
path = boost-math
9+
url = https://github.com/boostorg/math.git

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"files.exclude": {
1313
"llvm-project": true,
1414
"stl/msbuild": true,
15-
"vcpkg": true
15+
"boost-math": true
1616
},
1717
"files.insertFinalNewline": true,
1818
"files.trimFinalNewlines": true,

CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
# Copyright (c) Microsoft Corporation.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
5-
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
6-
endif()
7-
84
cmake_minimum_required(VERSION 3.20)
95
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
106
project(msvc_standard_libraries LANGUAGES CXX)
117

12-
find_package(Boost REQUIRED)
13-
14-
set(VCLIBS_MIN_BOOST_VERSION 1.76.0)
15-
if("${Boost_VERSION}" VERSION_LESS "${VCLIBS_MIN_BOOST_VERSION}")
16-
message(FATAL_ERROR "Detected Boost version is too old (older than ${VCLIBS_MIN_BOOST_VERSION}).")
17-
endif()
18-
198
option(BUILD_TESTING "Enable testing" ON)
209
set(VCLIBS_SUFFIX "_oss" CACHE STRING "suffix for built DLL names to avoid conflicts with distributed DLLs")
2110

@@ -90,6 +79,7 @@ get_filename_component(TOOLSET_ROOT_DIR "${TOOLSET_ROOT_DIR}" DIRECTORY) # $\VC\
9079

9180
set(TOOLSET_LIB "${TOOLSET_ROOT_DIR}/lib/${VCLIBS_X86_OR_X64}")
9281

82+
add_subdirectory(boost-math)
9383
add_subdirectory(stl)
9484

9585
if(BUILD_TESTING)

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem
140140

141141
# How To Build With The Visual Studio IDE
142142

143-
The STL uses boost-math headers to provide P0226R1 Mathematical Special Functions. We recommend using [vcpkg][] to
144-
acquire this dependency.
145-
146143
1. Install Visual Studio 2022 17.0 Preview 3 or later.
147144
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
148145
This will ensure that you're using supported versions of CMake and Ninja.
@@ -152,10 +149,8 @@ acquire this dependency.
152149
2. Open Visual Studio, and choose the "Clone or check out code" option. Enter the URL of this repository,
153150
`https://github.com/microsoft/STL`.
154151
3. Open a terminal in the IDE with `` Ctrl + ` `` (by default) or press on "View" in the top bar, and then "Terminal".
155-
4. In the terminal, invoke `git submodule update --init --progress llvm-project vcpkg`
156-
5. In the terminal, invoke `.\vcpkg\bootstrap-vcpkg.bat`
157-
6. In the terminal, invoke `.\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows`
158-
7. Choose the architecture you wish to build in the IDE, and build as you would any other project. All necessary CMake
152+
4. In the terminal, invoke `git submodule update --init --progress llvm-project boost-math`
153+
5. Choose the architecture you wish to build in the IDE, and build as you would any other project. All necessary CMake
159154
settings are set by `CMakeSettings.json`.
160155

161156
# How To Build With A Native Tools Command Prompt
@@ -169,9 +164,6 @@ acquire this dependency.
169164
2. Open a command prompt.
170165
3. Change directories to a location where you'd like a clone of this STL repository.
171166
4. `git clone https://github.com/microsoft/STL --recurse-submodules`
172-
5. `cd STL`
173-
6. `.\vcpkg\bootstrap-vcpkg.bat`
174-
7. `.\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows`
175167

176168
To build the x86 target:
177169

@@ -476,5 +468,4 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
476468
[lit result codes]: https://llvm.org/docs/CommandGuide/lit.html#test-status-results
477469
[opencode@microsoft.com]: mailto:opencode@microsoft.com
478470
[redistributables]: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
479-
[vcpkg]: https://github.com/microsoft/vcpkg
480471
[natvis documentation]: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects

azure-devops/checkout-sources.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

44
parameters:
5-
- name: vcpkgSHAVar
6-
type: string
7-
default: vcpkgSHA
85
- name: llvmSHAVar
96
type: string
107
default: llvmSHA
8+
- name: boostMathSHAVar
9+
type: string
10+
default: boostMathSHA
1111
steps:
1212
- checkout: self
1313
clean: true
@@ -22,8 +22,8 @@ steps:
2222
$regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$'
2323
$llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'}
2424
Write-Host "##vso[task.setvariable variable=${{ parameters.llvmSHAVar }};]$llvmSHA"
25-
$vcpkgSHA = git submodule status --cached vcpkg | %{$_ -replace $regexSubmoduleSHA, '$1'}
26-
Write-Host "##vso[task.setvariable variable=${{ parameters.vcpkgSHAVar }};]$vcpkgSHA"
25+
$boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'}
26+
Write-Host "##vso[task.setvariable variable=${{ parameters.boostMathSHAVar }};]$boostMathSHA"
2727
- script: |
2828
cd $(Build.SourcesDirectory)
2929
if not exist "llvm-project" (
@@ -50,22 +50,22 @@ steps:
5050
displayName: "Checkout LLVM source"
5151
- script: |
5252
cd $(Build.SourcesDirectory)
53-
if not exist "vcpkg" (
54-
mkdir vcpkg
53+
if not exist "boost-math" (
54+
mkdir boost-math
5555
)
56-
cd vcpkg
56+
cd boost-math
5757
5858
if not exist ".git" (
5959
del /S /Q *
6060
git init
6161
)
6262
63-
git remote get-url vcpkg
63+
git remote get-url boostorg
6464
if errorlevel 1 (
65-
git remote add vcpkg https://github.com/Microsoft/vcpkg.git
66-
git config --local extensions.partialClone vcpkg
65+
git remote add boostorg https://github.com/boostorg/math.git
66+
git config --local extensions.partialClone boostorg
6767
)
6868
69-
git fetch --filter=tree:0 --depth=1 vcpkg $(${{ parameters.vcpkgSHAVar }})
69+
git fetch --filter=tree:0 --depth=1 boostorg $(${{ parameters.boostMathSHAVar }})
7070
git checkout -f FETCH_HEAD
71-
displayName: "Checkout vcpkg source"
71+
displayName: "Checkout boost-math source"

azure-devops/cmake-configure-build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ parameters:
66
type: string
77
- name: targetArch
88
type: string
9-
- name: vcpkgLocationVar
10-
type: string
11-
default: vcpkgLocation
129
- name: targetPlatform
1310
type: string
1411
- name: buildOutputLocationVar
@@ -33,8 +30,6 @@ steps:
3330
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
3431
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
3532
cmake ${{ parameters.cmakeAdditionalFlags}} -G Ninja ^
36-
-DCMAKE_TOOLCHAIN_FILE=$(${{ parameters.vcpkgLocationVar }})\scripts\buildsystems\vcpkg.cmake ^
37-
-DVCPKG_TARGET_TRIPLET=${{ parameters.targetPlatform }}-windows ^
3833
-DCMAKE_CXX_COMPILER=cl ^
3934
-DCMAKE_BUILD_TYPE=Release ^
4035
-DLIT_FLAGS=$(litFlags) ^

azure-devops/cross-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
displayName: 'Setup TMP Directory'
3434
3535
- template: checkout-sources.yml
36-
- template: vcpkg-dependencies.yml
37-
parameters:
38-
targetPlatform: ${{ parameters.targetPlatform }}
3936
- template: cmake-configure-build.yml
4037
parameters:
4138
targetPlatform: ${{ parameters.targetPlatform }}

azure-devops/native-build-test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ jobs:
3030
displayName: 'Setup TMP Directory'
3131
3232
- template: checkout-sources.yml
33-
- template: vcpkg-dependencies.yml
34-
parameters:
35-
targetPlatform: ${{ parameters.targetPlatform }}
3633
- template: cmake-configure-build.yml
3734
parameters:
3835
targetPlatform: ${{ parameters.targetPlatform }}

azure-devops/vcpkg-dependencies.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)