@@ -129,42 +129,6 @@ target_sources(graphql_introspection_modules
129
129
FILES
130
130
${INTROSPECTION_MODULES} )
131
131
132
- function (check_coroutine_impl OPTIONAL_FLAGS OUT_RESULT )
133
- set (TEST_FILE "test_coroutine.cpp" )
134
- file (COPY ${CMAKE_CURRENT_SOURCE_DIR} /../cmake/${TEST_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
135
-
136
- try_compile (TEST_RESULT
137
- ${CMAKE_CURRENT_BINARY_DIR}
138
- ${CMAKE_CURRENT_BINARY_DIR} /${TEST_FILE}
139
- CXX_STANDARD 20 )
140
-
141
- if (NOT TEST_RESULT )
142
- # Retry with each of the optional flags.
143
- foreach (OPTIONAL_FLAG IN LISTS OPTIONAL_FLAGS )
144
- try_compile (TEST_RESULT
145
- ${CMAKE_CURRENT_BINARY_DIR}
146
- ${CMAKE_CURRENT_BINARY_DIR} /${TEST_FILE}
147
- CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPTIONAL_FLAG} "
148
- CXX_STANDARD 20 )
149
-
150
- if (TEST_RESULT )
151
- # Looks like the optional flag was required, go ahead and add it to the compile options.
152
- target_compile_options (graphql_internal_modules INTERFACE ${OPTIONAL_FLAG} )
153
- break ()
154
- endif ()
155
- endforeach (OPTIONAL_FLAG )
156
- endif ()
157
-
158
- set (${OUT_RESULT} ${TEST_RESULT} PARENT_SCOPE )
159
- endfunction ()
160
-
161
- check_coroutine_impl ("-fcoroutines" STD_COROUTINE )
162
- if (STD_COROUTINE )
163
- message (STATUS "Using std coroutine" )
164
- else ()
165
- message (FATAL_ERROR "Missing coroutine support" )
166
- endif ()
167
-
168
132
# graphqlpeg
169
133
add_library (graphqlpeg SyntaxTree.cpp )
170
134
add_library (cppgraphqlgen::graphqlpeg ALIAS graphqlpeg )
@@ -342,43 +306,8 @@ if(GRAPHQL_BUILD_SCHEMAGEN)
342
306
RUNTIME DESTINATION ${GRAPHQL_INSTALL_TOOLS_DIR} /${PROJECT_NAME} )
343
307
endif ()
344
308
345
- # Common schemagen and clientgen filesystem and Boost dependencies
309
+ # Common schemagen and clientgen Boost dependencies
346
310
if (GRAPHQL_BUILD_SCHEMAGEN OR GRAPHQL_BUILD_CLIENTGEN )
347
- # Try compiling a test program with std::filesystem or one of its alternatives.
348
- function (check_filesystem_impl OPTIONAL_LIBS )
349
- try_compile (TEST_RESULT
350
- ${CMAKE_CURRENT_BINARY_DIR}
351
- ${CMAKE_CURRENT_SOURCE_DIR} /../cmake/test_filesystem.cpp
352
- CXX_STANDARD 20 )
353
-
354
- if (NOT TEST_RESULT )
355
- # Retry with each of the optional libraries.
356
- foreach (OPTIONAL_LIB IN LISTS OPTIONAL_LIBS )
357
- try_compile (TEST_RESULT
358
- ${CMAKE_CURRENT_BINARY_DIR}
359
- ${CMAKE_CURRENT_BINARY_DIR} /${TEST_FILE}
360
- LINK_LIBRARIES ${OPTIONAL_LIB}
361
- CXX_STANDARD 20 )
362
-
363
- if (TEST_RESULT )
364
- # Looks like the optional library was required, go ahead and add it to the link options.
365
- if (GRAPHQL_BUILD_SCHEMAGEN )
366
- target_link_libraries (schemagen PRIVATE ${OPTIONAL_LIB} )
367
- endif ()
368
- if (GRAPHQL_BUILD_CLIENTGEN )
369
- target_link_libraries (clientgen PRIVATE ${OPTIONAL_LIB} )
370
- endif ()
371
- break ()
372
- endif ()
373
- endforeach (OPTIONAL_LIB )
374
- endif ()
375
- endfunction (check_filesystem_impl )
376
-
377
- # Try compiling a minimal program without any extra libraries, then with each optional library until it succeeded:
378
- # stdc++fs
379
- # c++fs
380
- check_filesystem_impl ("stdc++fs;c++fs" STD_FILESYTEM )
381
-
382
311
find_package (boost_program_options CONFIG REQUIRED )
383
312
if (GRAPHQL_BUILD_SCHEMAGEN )
384
313
target_link_libraries (schemagen PRIVATE Boost::program_options )
0 commit comments