Skip to content

Commit d4e8457

Browse files
committed
Fix macOS build
1 parent 5d141ed commit d4e8457

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

.github/workflows/linux.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,29 @@ jobs:
1717
submodules: true
1818

1919
- name: Install Dependencies
20-
run: sudo apt-get update && sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build
2123
2224
- name: Build GTest
23-
run: cmake -E make_directory gtest && cd gtest && cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G Ninja /usr/src/gtest && cmake --build . -j -v && sudo cmake --install .
25+
run: |
26+
cmake -E make_directory gtest
27+
cd gtest
28+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G Ninja /usr/src/gtest
29+
cmake --build . -j -v
30+
sudo cmake --install .
2431
2532
- name: Create Build Environment
2633
run: cmake -E make_directory build
2734

2835
- name: Configure CMake
2936
working-directory: build
30-
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G Ninja $GITHUB_WORKSPACE
37+
run: cmake -G Ninja ${{ github.workspace }}
3138

32-
- name: Build the Project
39+
- name: Build
3340
working-directory: build
34-
run: cmake --build . -j -v
41+
run: cmake --build . --config ${{ matrix.config }} -j -v
3542

36-
- name: Run the Tests
43+
- name: Test
3744
working-directory: build
38-
run: ctest --output-on-failure
45+
run: ctest -C ${{ matrix.config }} --output-on-failure

.github/workflows/macos.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,10 @@ jobs:
4444
4545
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" ${{ github.workspace }}
4646
47-
- name: Configure
48-
working-directory: build/
49-
run: cmake $GITHUB_WORKSPACE
50-
5147
- name: Build
5248
working-directory: build/
53-
run: cmake --build . --config ${{ matrix.build_type }} -j -v
49+
run: cmake --build . --config ${{ matrix.config }} -v
5450

5551
- name: Test
5652
working-directory: build/
57-
run: ctest --config ${{ matrix.build_type }} --output-on-failure
53+
run: ctest -C ${{ matrix.config }} --output-on-failure

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Build
5858
working-directory: build/
59-
run: cmake --build . --config ${{ matrix.config }} -j -v
59+
run: cmake --build . --config ${{ matrix.config }} -v
6060

6161
- name: Test
6262
working-directory: build/

include/graphqlservice/GraphQLSchema.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ class Schema : public std::enable_shared_from_this<Schema>
6767
std::shared_ptr<const ObjectType> _query;
6868
std::shared_ptr<const ObjectType> _mutation;
6969
std::shared_ptr<const ObjectType> _subscription;
70-
std::unordered_map<std::string_view, size_t> _typeMap;
70+
internal::sorted_map<std::string_view, size_t> _typeMap;
7171
std::vector<std::pair<std::string_view, std::shared_ptr<const BaseType>>> _types;
7272
std::vector<std::shared_ptr<const Directive>> _directives;
73-
std::unordered_map<std::shared_ptr<const BaseType>, std::shared_ptr<const BaseType>>
73+
internal::sorted_map<std::shared_ptr<const BaseType>, std::shared_ptr<const BaseType>>
7474
_nonNullWrappers;
75-
std::unordered_map<std::shared_ptr<const BaseType>, std::shared_ptr<const BaseType>>
75+
internal::sorted_map<std::shared_ptr<const BaseType>, std::shared_ptr<const BaseType>>
7676
_listWrappers;
7777
};
7878

src/GraphQLSchema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const std::shared_ptr<const BaseType>& Schema::LookupType(std::string_view name)
4343
{
4444
auto itr = _typeMap.find(name);
4545

46-
if (itr == _typeMap.cend())
46+
if (itr == _typeMap.end())
4747
{
4848
std::ostringstream message;
4949

@@ -66,9 +66,9 @@ const std::shared_ptr<const BaseType>& Schema::WrapType(
6666
auto& wrappers = (kind == introspection::TypeKind::LIST) ? _listWrappers : _nonNullWrappers;
6767
auto itr = wrappers.find(ofType);
6868

69-
if (itr == wrappers.cend())
69+
if (itr == wrappers.end())
7070
{
71-
std::tie(itr, std::ignore) = wrappers.insert({ ofType, WrapperType::Make(kind, ofType) });
71+
std::tie(itr, std::ignore) = wrappers.emplace(ofType, WrapperType::Make(kind, ofType));
7272
}
7373

7474
return itr->second;

0 commit comments

Comments
 (0)