diff options
author | crupest <crupest@outlook.com> | 2021-04-12 23:00:12 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-12 23:00:12 +0800 |
commit | 01bbdbe1420c1da4e9bd9595582a9e2d97f32a85 (patch) | |
tree | 8dcdebf81cc9185bc148c1cd3572e8066cdb8cb1 | |
parent | 4bc40b874d63442faf42fecc789f15db0a80e440 (diff) | |
download | cru-01bbdbe1420c1da4e9bd9595582a9e2d97f32a85.tar.gz cru-01bbdbe1420c1da4e9bd9595582a9e2d97f32a85.tar.bz2 cru-01bbdbe1420c1da4e9bd9595582a9e2d97f32a85.zip |
...
-rw-r--r-- | .github/workflows/ci.yml | 24 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/win_build.py | 16 | ||||
m--------- | vcpkg | 0 | ||||
-rw-r--r-- | vcpkg.json | 6 |
7 files changed, 22 insertions, 30 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3aa088a5..d970e264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ on: - "drafts/**" - "**/README.md" +env: + VCPKG_FEATURE_FLAGS: manifests + jobs: build: name: Build @@ -22,27 +25,16 @@ jobs: matrix: buildConfiguration: [Debug, Release] architecture: [x86, x64] - include: - - architecture: x86 - triplet: x86-windows - - architecture: x64 - triplet: x64-windows fail-fast: true - env: - vcpkgPackages: "gtest fmt ms-gsl" - steps: - uses: actions/checkout@v2 - with: - submodules: true - - name: Restore artifacts, or run vcpkg, build and cache artifacts - uses: lukka/run-vcpkg@v6 - id: runvcpkg + - name: Restore Cache + uses: actions/cache@v2 with: - vcpkgArguments: "${{ env.vcpkgPackages }}" - vcpkgTriplet: "${{ matrix.triplet }}" + path: vcpkg_installed + key: vcpkg-${{ runner.os }} - name: Run build script - run: python tools\win_build.py -a ${{ matrix.architecture }} -c ${{ matrix.buildConfiguration }} --skip-install-packages + run: python tools\win_build.py -a ${{ matrix.architecture }} -c ${{ matrix.buildConfiguration }} @@ -593,3 +593,4 @@ compile_flags.txt .clangd .kdev4 CruUI.kdev4 +vcpkg_installed diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3c19d8d0..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "vcpkg"] - path = vcpkg - url = https://github.com/Microsoft/vcpkg diff --git a/CMakeLists.txt b/CMakeLists.txt index bb7b62df..09c0b114 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14) -set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake +set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") project(CruUI) diff --git a/tools/win_build.py b/tools/win_build.py index 6cb079b4..c011aafe 100644 --- a/tools/win_build.py +++ b/tools/win_build.py @@ -22,11 +22,6 @@ 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) -vcpkg_root = os.path.join(project_root, 'vcpkg') - -cmake_toolchain_path = os.path.join( - vcpkg_root, 'scripts/buildsystems/vcpkg.cmake') - # this is not used when generator is Visual Studio @@ -44,8 +39,8 @@ cmake_toolchain_path = os.path.join( # os.environ[k] = v def install_packages(): - 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) + subprocess.check_call( + 'vcpkg install', stdout=sys.stdout, stderr=sys.stderr) def configure(): @@ -55,13 +50,14 @@ def configure(): } # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - subprocess.check_call('cmake -S . -B {build_dir} -G "Visual Studio 16 2019" -A {arch} -T host=x64 -DCMAKE_TOOLCHAIN_FILE={toolchain}' - .format(build_dir=work_dir, arch=generater_vs_arch_map[args.arch], toolchain=cmake_toolchain_path), + subprocess.check_call('cmake -S . -B {build_dir} -G "Visual Studio 16 2019" -A {arch} -T host=x64' + .format(build_dir=work_dir, arch=generater_vs_arch_map[args.arch]), stdout=sys.stdout, stderr=sys.stderr) def build(): - subprocess.check_call('cmake --build {build_dir} --target ALL_BUILD --config {config}'.format(build_dir=work_dir, config=args.config), + subprocess.check_call('cmake --build {build_dir} --target ALL_BUILD --config {config}' + .format(build_dir=work_dir, config=args.config), stdout=sys.stdout, stderr=sys.stderr) diff --git a/vcpkg b/vcpkg deleted file mode 160000 -Subproject 13640c56717dec1bba16c6eb0815d3889dbe1c4 diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..0e89b26e --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "name": "cruui", + "version": "0.0.1", + "dependencies": ["ms-gsl", "fmt", "gtest"] +} |