Skip to content

Commit 5dc0f90

Browse files
committed
fix(gcc): try specifying -fabi-version=0
1 parent 22ed39d commit 5dc0f90

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

samples/today/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ cmake_minimum_required(VERSION 3.28)
77
add_subdirectory(schema)
88
add_library(todaygraphql STATIC TodayMock.cpp)
99
target_compile_features(todaygraphql PUBLIC cxx_std_20)
10+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
11+
target_compile_options(todaygraphql PUBLIC "-fabi-version=0")
12+
endif()
1013
target_link_libraries(todaygraphql PUBLIC today_schema)
1114
target_sources(todaygraphql PUBLIC FILE_SET CXX_MODULES
1215
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
@@ -16,6 +19,9 @@ target_sources(todaygraphql PUBLIC FILE_SET CXX_MODULES
1619
add_subdirectory(nointrospection)
1720
add_library(todaygraphql_nointrospection STATIC TodayMock.cpp)
1821
target_compile_features(todaygraphql_nointrospection PUBLIC cxx_std_20)
22+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
23+
target_compile_options(todaygraphql_nointrospection PUBLIC "-fabi-version=0")
24+
endif()
1925
target_link_libraries(todaygraphql_nointrospection PUBLIC today_nointrospection_schema)
2026
target_sources(todaygraphql_nointrospection PUBLIC FILE_SET CXX_MODULES
2127
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
@@ -29,28 +35,24 @@ endif()
2935

3036
# sample
3137
add_executable(sample sample.cpp)
32-
target_compile_features(sample PUBLIC cxx_std_20)
3338
target_link_libraries(sample PRIVATE
3439
todaygraphql
3540
graphqljson)
3641

3742
# sample_nointrospection
3843
add_executable(sample_nointrospection sample.cpp)
39-
target_compile_features(sample_nointrospection PUBLIC cxx_std_20)
4044
target_link_libraries(sample_nointrospection PRIVATE
4145
todaygraphql_nointrospection
4246
graphqljson)
4347

4448
# benchmark
4549
add_executable(benchmark benchmark.cpp)
46-
target_compile_features(benchmark PUBLIC cxx_std_20)
4750
target_link_libraries(benchmark PRIVATE
4851
todaygraphql
4952
graphqljson)
5053

5154
# benchmark_nointrospection
5255
add_executable(benchmark_nointrospection benchmark.cpp)
53-
target_compile_features(benchmark_nointrospection PUBLIC cxx_std_20)
5456
target_link_libraries(benchmark_nointrospection PRIVATE
5557
todaygraphql_nointrospection
5658
graphqljson)

samples/today/TodayMock.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,33 @@ std::unique_ptr<TodayMockService> mock_service() noexcept
6363
auto result = std::make_unique<TodayMockService>();
6464

6565
auto query = std::make_shared<Query>(
66-
[mockService = result.get()]() noexcept -> std::vector<std::shared_ptr<Appointment>> {
66+
[mockService = result.get()]() -> std::vector<std::shared_ptr<Appointment>> {
6767
++mockService->getAppointmentsCount;
6868
return { std::make_shared<Appointment>(response::IdType(getFakeAppointmentId()),
6969
"tomorrow",
7070
"Lunch?",
7171
false) };
7272
},
73-
[mockService = result.get()]() noexcept -> std::vector<std::shared_ptr<Task>> {
73+
[mockService = result.get()]() -> std::vector<std::shared_ptr<Task>> {
7474
++mockService->getTasksCount;
7575
return {
7676
std::make_shared<Task>(response::IdType(getFakeTaskId()), "Don't forget", true)
7777
};
7878
},
79-
[mockService = result.get()]() noexcept -> std::vector<std::shared_ptr<Folder>> {
79+
[mockService = result.get()]() -> std::vector<std::shared_ptr<Folder>> {
8080
++mockService->getUnreadCountsCount;
8181
return {
8282
std::make_shared<Folder>(response::IdType(getFakeFolderId()), "\"Fake\" Inbox", 3)
8383
};
8484
});
8585
auto mutation = std::make_shared<Mutation>(
86-
[](CompleteTaskInput&& input) noexcept -> std::shared_ptr<CompleteTaskPayload> {
86+
[](CompleteTaskInput&& input) -> std::shared_ptr<CompleteTaskPayload> {
8787
return std::make_shared<CompleteTaskPayload>(
8888
std::make_shared<Task>(std::move(input.id), "Mutated Task!", *(input.isComplete)),
8989
std::move(input.clientMutationId));
9090
});
9191
auto subscription = std::make_shared<NextAppointmentChange>(
92-
[](const std::shared_ptr<service::RequestState>&) noexcept -> std::shared_ptr<Appointment> {
92+
[](const std::shared_ptr<service::RequestState>&) -> std::shared_ptr<Appointment> {
9393
return { std::make_shared<Appointment>(response::IdType(getFakeAppointmentId()),
9494
"tomorrow",
9595
"Lunch?",

test/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ add_bigobj_flag(validation_tests)
1515
gtest_add_tests(TARGET validation_tests)
1616

1717
add_executable(today_tests TodayTests.cpp)
18-
target_compile_features(today_tests PRIVATE cxx_std_20)
1918
target_link_libraries(today_tests PRIVATE
2019
todaygraphql
2120
graphqljson
@@ -25,7 +24,6 @@ add_bigobj_flag(today_tests)
2524
gtest_add_tests(TARGET today_tests)
2625

2726
add_executable(coroutine_tests CoroutineTests.cpp)
28-
target_compile_features(coroutine_tests PRIVATE cxx_std_20)
2927
target_link_libraries(coroutine_tests PRIVATE
3028
todaygraphql
3129
graphqljson
@@ -34,7 +32,6 @@ target_link_libraries(coroutine_tests PRIVATE
3432
gtest_add_tests(TARGET coroutine_tests)
3533

3634
add_executable(client_tests ClientTests.cpp)
37-
target_compile_features(client_tests PRIVATE cxx_std_20)
3835
target_link_libraries(client_tests PRIVATE
3936
todaygraphql
4037
query_client
@@ -46,7 +43,6 @@ add_bigobj_flag(client_tests)
4643
gtest_add_tests(TARGET client_tests)
4744

4845
add_executable(nointrospection_tests NoIntrospectionTests.cpp)
49-
target_compile_features(nointrospection_tests PRIVATE cxx_std_20)
5046
target_link_libraries(nointrospection_tests PRIVATE
5147
todaygraphql_nointrospection
5248
graphqljson
@@ -56,7 +52,6 @@ add_bigobj_flag(nointrospection_tests)
5652
gtest_add_tests(TARGET nointrospection_tests)
5753

5854
add_executable(argument_tests ArgumentTests.cpp)
59-
target_compile_features(argument_tests PRIVATE cxx_std_20)
6055
target_link_libraries(argument_tests PRIVATE
6156
todaygraphql
6257
graphqljson

0 commit comments

Comments
 (0)