Skip to content

Commit 10d1124

Browse files
committed
fix(build): build today and stitched samples without modules
1 parent 876b0cb commit 10d1124

File tree

2 files changed

+48
-53
lines changed

2 files changed

+48
-53
lines changed

samples/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@
33

44
cmake_minimum_required(VERSION 3.28)
55

6-
if(GRAPHQL_BUILD_MODULES)
7-
add_subdirectory(today)
8-
endif()
9-
6+
add_subdirectory(today)
107
add_subdirectory(client)
118
add_subdirectory(learn)
12-
13-
if(GRAPHQL_BUILD_MODULES)
14-
add_subdirectory(stitched)
15-
endif()
16-
9+
add_subdirectory(stitched)
1710
add_subdirectory(validation)
1811

1912
if(GRAPHQL_BUILD_HTTP_SAMPLE)

samples/today/CMakeLists.txt

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,51 @@ if(MSVC)
3737
target_compile_options(todaygraphql_nointrospection PUBLIC /wd4702)
3838
endif()
3939

40-
# sample
41-
add_executable(sample sample.cpp)
42-
target_link_libraries(sample PRIVATE
43-
todaygraphql
44-
graphqljson)
45-
46-
# sample_nointrospection
47-
add_executable(sample_nointrospection sample.cpp)
48-
target_link_libraries(sample_nointrospection PRIVATE
49-
todaygraphql_nointrospection
50-
graphqljson)
51-
52-
# benchmark
53-
add_executable(benchmark benchmark.cpp)
54-
target_link_libraries(benchmark PRIVATE
55-
todaygraphql
56-
graphqljson)
57-
58-
# benchmark_nointrospection
59-
add_executable(benchmark_nointrospection benchmark.cpp)
60-
target_link_libraries(benchmark_nointrospection PRIVATE
61-
todaygraphql_nointrospection
62-
graphqljson)
63-
64-
if(WIN32 AND BUILD_SHARED_LIBS)
65-
add_custom_command(OUTPUT copied_sample_dlls
66-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
67-
$<TARGET_FILE:graphqlservice>
68-
$<TARGET_FILE:graphqljson>
69-
$<TARGET_FILE:graphqlpeg>
70-
$<TARGET_FILE:graphqlresponse>
71-
${CMAKE_CURRENT_BINARY_DIR}
72-
COMMAND ${CMAKE_COMMAND} -E touch copied_sample_dlls
73-
DEPENDS
74-
graphqlservice
75-
graphqljson
76-
graphqlpeg
77-
graphqlresponse)
78-
79-
add_custom_target(copy_today_sample_dlls DEPENDS copied_sample_dlls)
40+
if(GRAPHQL_BUILD_MODULES)
41+
# sample
42+
add_executable(sample sample.cpp)
43+
target_link_libraries(sample PRIVATE
44+
todaygraphql
45+
graphqljson)
8046

81-
add_dependencies(sample copy_today_sample_dlls)
82-
add_dependencies(sample_nointrospection copy_today_sample_dlls)
83-
add_dependencies(benchmark copy_today_sample_dlls)
84-
add_dependencies(benchmark_nointrospection copy_today_sample_dlls)
47+
# sample_nointrospection
48+
add_executable(sample_nointrospection sample.cpp)
49+
target_link_libraries(sample_nointrospection PRIVATE
50+
todaygraphql_nointrospection
51+
graphqljson)
52+
53+
# benchmark
54+
add_executable(benchmark benchmark.cpp)
55+
target_link_libraries(benchmark PRIVATE
56+
todaygraphql
57+
graphqljson)
58+
59+
# benchmark_nointrospection
60+
add_executable(benchmark_nointrospection benchmark.cpp)
61+
target_link_libraries(benchmark_nointrospection PRIVATE
62+
todaygraphql_nointrospection
63+
graphqljson)
64+
65+
if(WIN32 AND BUILD_SHARED_LIBS)
66+
add_custom_command(OUTPUT copied_sample_dlls
67+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
68+
$<TARGET_FILE:graphqlservice>
69+
$<TARGET_FILE:graphqljson>
70+
$<TARGET_FILE:graphqlpeg>
71+
$<TARGET_FILE:graphqlresponse>
72+
${CMAKE_CURRENT_BINARY_DIR}
73+
COMMAND ${CMAKE_COMMAND} -E touch copied_sample_dlls
74+
DEPENDS
75+
graphqlservice
76+
graphqljson
77+
graphqlpeg
78+
graphqlresponse)
79+
80+
add_custom_target(copy_today_sample_dlls DEPENDS copied_sample_dlls)
81+
82+
add_dependencies(sample copy_today_sample_dlls)
83+
add_dependencies(sample_nointrospection copy_today_sample_dlls)
84+
add_dependencies(benchmark copy_today_sample_dlls)
85+
add_dependencies(benchmark_nointrospection copy_today_sample_dlls)
86+
endif()
8587
endif()

0 commit comments

Comments
 (0)