-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from wravery/next
Groundwork in CMake, build workflows, and header include cleanup
- Loading branch information
Showing
47 changed files
with
172 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ name: Linux | |
on: [push, pull_request] | ||
|
||
jobs: | ||
gcc10: | ||
gcc14: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: [Debug, Release] | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -19,7 +19,10 @@ jobs: | |
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build gcc-10 g++-10 | ||
sudo apt-get upgrade | ||
sudo add-apt-repository -y universe | ||
sudo apt-get update | ||
sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build gcc-14 g++-14 | ||
- name: Build GTest | ||
run: | | ||
|
@@ -35,8 +38,8 @@ jobs: | |
- name: Configure CMake | ||
shell: pwsh | ||
env: | ||
CC: gcc-10 | ||
CXX: g++-10 | ||
CC: gcc-14 | ||
CXX: g++-14 | ||
working-directory: build/ | ||
run: | | ||
$cmakeBuildType = '${{ matrix.config }}' | ||
|
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 |
---|---|---|
|
@@ -9,38 +9,51 @@ jobs: | |
matrix: | ||
config: [Debug, Release] | ||
|
||
runs-on: macos-13 | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 | ||
|
||
- name: Cache vcpkg | ||
uses: actions/[email protected] | ||
id: cache-vcpkg | ||
with: | ||
path: build/vcpkg_cache/ | ||
key: vcpkg-binaries-x64-osx | ||
key: vcpkg-binaries-osx-${{ hashFiles('vcpkg.json') }} | ||
|
||
- name: Create Build Environment | ||
if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} | ||
run: | | ||
cmake -E make_directory build | ||
cmake -E make_directory build/vcpkg_cache | ||
- name: Boostrap vcpkg | ||
shell: pwsh | ||
working-directory: vcpkg/ | ||
run: | | ||
./bootstrap-vcpkg.sh | ||
./vcpkg integrate install | ||
- name: Configure | ||
shell: pwsh | ||
env: | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
working-directory: build/ | ||
run: | | ||
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve | ||
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve | ||
$cmakeBuildType = '${{ matrix.config }}' | ||
$cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve | ||
$cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' }) | ||
$env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess" | ||
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" ${{ github.workspace }} | ||
$env:PATH = "${env:PATH}:${{ github.workspace }}/ninja-build" | ||
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" -G Ninja ${{ github.workspace }} | ||
- name: Build | ||
working-directory: build/ | ||
|
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Set target triplet | ||
id: set-variables | ||
|
@@ -28,19 +29,28 @@ jobs: | |
id: cache-vcpkg | ||
with: | ||
path: build/vcpkg_cache/ | ||
key: vcpkg-binaries-${{ steps.set-variables.outputs.vcpkg_triplet }} | ||
key: vcpkg-binaries-${{ steps.set-variables.outputs.vcpkg_triplet }}-${{ hashFiles('vcpkg.json') }} | ||
|
||
- name: Create Build Environment | ||
if: ${{ !steps.cache-vcpkg.outputs.cache-hit }} | ||
run: | | ||
cmake -E make_directory build | ||
cmake -E make_directory build/vcpkg_cache | ||
- name: Boostrap vcpkg | ||
shell: pwsh | ||
working-directory: vcpkg/ | ||
run: | | ||
./bootstrap-vcpkg.bat | ||
./vcpkg integrate install | ||
- name: Configure | ||
shell: pwsh | ||
env: | ||
VCPKG_ROOT: ${{ github.workspace }}\vcpkg | ||
working-directory: build/ | ||
run: | | ||
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve | ||
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve | ||
$vcpkgTriplet = '${{ steps.set-variables.outputs.vcpkg_triplet }}' | ||
$cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' }) | ||
$msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' }) | ||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "PEGTL"] | ||
path = PEGTL | ||
url = https://github.com/taocpp/PEGTL.git | ||
[submodule "vcpkg"] | ||
path = vcpkg | ||
url = https://github.com/microsoft/vcpkg.git |
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
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,49 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#pragma once | ||
|
||
#ifndef DLLEXPORTS_H | ||
#define DLLEXPORTS_H | ||
|
||
// clang-format off | ||
#ifdef GRAPHQL_DLLEXPORTS | ||
#ifdef IMPL_GRAPHQLCLIENT_DLL | ||
#define GRAPHQLCLIENT_EXPORT __declspec(dllexport) | ||
#else // !IMPL_GRAPHQLCLIENT_DLL | ||
#define GRAPHQLCLIENT_EXPORT __declspec(dllimport) | ||
#endif // !IMPL_GRAPHQLCLIENT_DLL | ||
|
||
#ifdef IMPL_GRAPHQLPEG_DLL | ||
#define GRAPHQLPEG_EXPORT __declspec(dllexport) | ||
#else // !IMPL_GRAPHQLPEG_DLL | ||
#define GRAPHQLPEG_EXPORT __declspec(dllimport) | ||
#endif // !IMPL_GRAPHQLPEG_DLL | ||
|
||
#ifdef IMPL_GRAPHQLRESPONSE_DLL | ||
#define GRAPHQLRESPONSE_EXPORT __declspec(dllexport) | ||
#else // !IMPL_GRAPHQLRESPONSE_DLL | ||
#define GRAPHQLRESPONSE_EXPORT __declspec(dllimport) | ||
#endif // !IMPL_GRAPHQLRESPONSE_DLL | ||
|
||
#ifdef IMPL_GRAPHQLSERVICE_DLL | ||
#define GRAPHQLSERVICE_EXPORT __declspec(dllexport) | ||
#else // !IMPL_GRAPHQLSERVICE_DLL | ||
#define GRAPHQLSERVICE_EXPORT __declspec(dllimport) | ||
#endif // !IMPL_GRAPHQLSERVICE_DLL | ||
|
||
#ifdef IMPL_JSONRESPONSE_DLL | ||
#define JSONRESPONSE_EXPORT __declspec(dllexport) | ||
#else // !IMPL_JSONRESPONSE_DLL | ||
#define JSONRESPONSE_EXPORT __declspec(dllimport) | ||
#endif // !IMPL_JSONRESPONSE_DLL | ||
#else // !GRAPHQL_DLLEXPORTS | ||
#define GRAPHQLCLIENT_EXPORT | ||
#define GRAPHQLPEG_EXPORT | ||
#define GRAPHQLRESPONSE_EXPORT | ||
#define GRAPHQLSERVICE_EXPORT | ||
#define JSONRESPONSE_EXPORT | ||
#endif // !GRAPHQL_DLLEXPORTS | ||
// clang-format on | ||
|
||
#endif // DLLEXPORTS_H |
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
Oops, something went wrong.