aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml1
-rw-r--r--.gitmodules3
-rw-r--r--.vscode/settings.json6
-rw-r--r--tools/win_build.py33
m---------vcpkg0
5 files changed, 22 insertions, 21 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 71c5d45c..87ac668e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -41,7 +41,6 @@ jobs:
with:
vcpkgArguments: "${{ env.vcpkgPackages }}"
vcpkgTriplet: "${{ matrix.triplet }}"
- vcpkgDirectory: "${{ runner.workspace }}/b/vcpkg"
- name: Prints outputs of run-vcpkg task
run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..3c19d8d0
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "vcpkg"]
+ path = vcpkg
+ url = https://github.com/Microsoft/vcpkg
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 0c147ac6..a53c1bbb 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -77,5 +77,9 @@
"locale": "cpp",
"xlocbuf": "cpp",
"xlocmes": "cpp"
- }
+ },
+ "cmake.configureSettings": {
+ "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/vcpkg/scripts/buildsystems/vcpkg.cmake",
+ },
+ "cmake.generator": "Ninja",
}
diff --git a/tools/win_build.py b/tools/win_build.py
index 7332af77..6cb079b4 100644
--- a/tools/win_build.py
+++ b/tools/win_build.py
@@ -22,11 +22,7 @@ args = parser.parse_args()
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
work_dir = os.path.join(project_root, args.work_dir)
-try:
- vcpkg_root = os.environ.get('VCPKG_INSTALLATION_ROOT')
-except:
- print('Failed to find vcpkg installation root by environment variable.')
- exit(1)
+vcpkg_root = os.path.join(project_root, 'vcpkg')
cmake_toolchain_path = os.path.join(
vcpkg_root, 'scripts/buildsystems/vcpkg.cmake')
@@ -34,22 +30,21 @@ cmake_toolchain_path = os.path.join(
# this is not used when generator is Visual Studio
-def init_vc_environment(arch):
- arch_bat_map = {
- 'x86': 'vcvarsamd64_x86',
- 'x64': 'vcvars64'
- }
- vars = subprocess.check_output(['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\{}'.format(
- arch_bat_map[arch]), '&&', 'set'], shell=True, text=True)
- for var in vars.splitlines():
- k, _, v = map(str.strip, var.strip().partition('='))
- if k.startswith('?'):
- continue
- os.environ[k] = v
-
+# def init_vc_environment(arch):
+# arch_bat_map = {
+# 'x86': 'vcvarsamd64_x86',
+# 'x64': 'vcvars64'
+# }
+# vars = subprocess.check_output(['C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\{}'.format(
+# arch_bat_map[arch]), '&&', 'set'], shell=True, text=True)
+# for var in vars.splitlines():
+# k, _, v = map(str.strip, var.strip().partition('='))
+# if k.startswith('?'):
+# continue
+# os.environ[k] = v
def install_packages():
- subprocess.check_call('vcpkg install gtest:{arch}-windows fmt:{arch}-windows ms-gsl:{arch}-windows'.format(arch=args.arch),
+ subprocess.check_call('vcpkg\\vcpkg.exe install gtest:{arch}-windows fmt:{arch}-windows ms-gsl:{arch}-windows'.format(arch=args.arch),
stdout=sys.stdout, stderr=sys.stderr)
diff --git a/vcpkg b/vcpkg
new file mode 160000
+Subproject c8ebb5aa936efc00a238a72c88b80d0223a2ba0