-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: load vcpkg chainload toolchains and triplets
Signed-off-by: msclock <msclock@qq.com>
- Loading branch information
Showing
30 changed files
with
604 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": 6, | ||
"include": [ | ||
"../arch/x64.json" | ||
], | ||
"configurePresets": [ | ||
{ | ||
"name": "x64-mingw-static", | ||
"hidden": true, | ||
"inherits": [ | ||
"x64" | ||
], | ||
"cacheVariables": { | ||
"VCPKG_TARGET_TRIPLET": "x64-mingw-static", | ||
"VCPKG_HOST_TRIPLET": "x64-mingw-static" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"version": 6, | ||
"include": [ | ||
"base.json", | ||
"os/darwin.json", | ||
"compilers/mingw.json", | ||
"triplets/x64-mingw-static.json" | ||
], | ||
"configurePresets": [ | ||
{ | ||
"name": "x64-mingw-static-darwin-mingw", | ||
"inherits": [ | ||
"base", | ||
"darwin", | ||
"mingw", | ||
"x64-mingw-static" | ||
] | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "x64-mingw-static-darwin-mingw", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-darwin-mingw" | ||
} | ||
], | ||
"testPresets": [ | ||
{ | ||
"name": "x64-mingw-static-darwin-mingw", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-darwin-mingw" | ||
} | ||
], | ||
"workflowPresets": [ | ||
{ | ||
"name": "x64-mingw-static-darwin-mingw", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "x64-mingw-static-darwin-mingw" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "x64-mingw-static-darwin-mingw" | ||
}, | ||
{ | ||
"type": "test", | ||
"name": "x64-mingw-static-darwin-mingw" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"version": 6, | ||
"include": [ | ||
"base.json", | ||
"os/linux.json", | ||
"compilers/mingw.json", | ||
"triplets/x64-mingw-static.json" | ||
], | ||
"configurePresets": [ | ||
{ | ||
"name": "x64-mingw-static-linux-mingw", | ||
"inherits": [ | ||
"base", | ||
"linux", | ||
"mingw", | ||
"x64-mingw-static" | ||
], | ||
"cacheVariables": { | ||
"USE_SANITIZER": "FALSE" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "x64-mingw-static-linux-mingw", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-linux-mingw" | ||
} | ||
], | ||
"testPresets": [ | ||
{ | ||
"name": "x64-mingw-static-linux-mingw", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-linux-mingw" | ||
} | ||
], | ||
"workflowPresets": [ | ||
{ | ||
"name": "x64-mingw-static-linux-mingw", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "x64-mingw-static-linux-mingw" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "x64-mingw-static-linux-mingw" | ||
}, | ||
{ | ||
"type": "test", | ||
"name": "x64-mingw-static-linux-mingw" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"version": 6, | ||
"include": [ | ||
"base.json", | ||
"os/windows.json", | ||
"compilers/mingw.json", | ||
"triplets/x64-mingw-static.json" | ||
], | ||
"configurePresets": [ | ||
{ | ||
"name": "x64-mingw-static-windows-mingw-gcc", | ||
"inherits": [ | ||
"base", | ||
"windows", | ||
"mingw", | ||
"x64-mingw-static" | ||
], | ||
"cacheVariables": { | ||
"USE_SANITIZER": "FALSE" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "x64-mingw-static-windows-mingw-gcc", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-windows-mingw-gcc" | ||
} | ||
], | ||
"testPresets": [ | ||
{ | ||
"name": "x64-mingw-static-windows-mingw-gcc", | ||
"inherits": "base", | ||
"configurePreset": "x64-mingw-static-windows-mingw-gcc" | ||
} | ||
], | ||
"workflowPresets": [ | ||
{ | ||
"name": "x64-mingw-static-windows-mingw-gcc", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "x64-mingw-static-windows-mingw-gcc" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "x64-mingw-static-windows-mingw-gcc" | ||
}, | ||
{ | ||
"type": "test", | ||
"name": "x64-mingw-static-windows-mingw-gcc" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#[[ | ||
SPDX-License-Identifier: MIT | ||
SPDX-FileCopyrightText: Copyright 2024 msclock | ||
]] | ||
|
||
# configure VCPKG_CHAINLOAD_TOOLCHAIN_FILE based on VCPKG_TARGET_TRIPLET and | ||
# VCPKG_TARGET_ARCHITECTURE | ||
function(_vcpkg_chainload_toolchain) | ||
if(DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE) | ||
return() | ||
endif() | ||
|
||
if(NOT DEFINED VCPKG_TARGET_TRIPLET OR NOT DEFINED VCPKG_TARGET_ARCHITECTURE) | ||
message( | ||
FATAL_ERROR | ||
"VCPKG_TARGET_TRIPLET and VCPKG_TARGET_ARCHITECTURE must be set before calling _vcpkg_chainload_toolchain()" | ||
) | ||
endif() | ||
|
||
string(LENGTH "${VCPKG_TARGET_ARCHITECTURE}-" _prefix_len) | ||
string(SUBSTRING ${VCPKG_TARGET_TRIPLET} ${_prefix_len} -1 _stripped_string) | ||
string(REPLACE "-" ";" _triplet_parts "${_stripped_string}") | ||
list(GET _triplet_parts 0 _chainload_toolchain_name) | ||
|
||
set(_toolchain "scripts/toolchains/${_chainload_toolchain_name}.cmake") | ||
|
||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${_toolchain}") | ||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE | ||
"${CMAKE_CURRENT_LIST_DIR}/${_toolchain}" | ||
CACHE INTERNAL "vcpkg chainload") | ||
elseif(EXISTS "${_VCPKG_ROOT}/${_toolchain}") | ||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE | ||
"${_VCPKG_ROOT}/${_toolchain}" | ||
CACHE INTERNAL "vcpkg chainload") | ||
else() | ||
message( | ||
WARNING | ||
"Could not find toolchain file for ${_chainload_toolchain_name}, skipping chainload" | ||
) | ||
endif() | ||
endfunction() |
Oops, something went wrong.