Skip to content

Commit 63af1a8

Browse files
committed
fix(cmake): remove old try_compile tests
1 parent 31150a2 commit 63af1a8

File tree

4 files changed

+1
-165
lines changed

4 files changed

+1
-165
lines changed

cmake/test_boost_beast.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

cmake/test_coroutine.cpp

Lines changed: 0 additions & 59 deletions
This file was deleted.

cmake/test_filesystem.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -129,42 +129,6 @@ target_sources(graphql_introspection_modules
129129
FILES
130130
${INTROSPECTION_MODULES})
131131

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-
168132
# graphqlpeg
169133
add_library(graphqlpeg SyntaxTree.cpp)
170134
add_library(cppgraphqlgen::graphqlpeg ALIAS graphqlpeg)
@@ -342,43 +306,8 @@ if(GRAPHQL_BUILD_SCHEMAGEN)
342306
RUNTIME DESTINATION ${GRAPHQL_INSTALL_TOOLS_DIR}/${PROJECT_NAME})
343307
endif()
344308

345-
# Common schemagen and clientgen filesystem and Boost dependencies
309+
# Common schemagen and clientgen Boost dependencies
346310
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-
382311
find_package(boost_program_options CONFIG REQUIRED)
383312
if(GRAPHQL_BUILD_SCHEMAGEN)
384313
target_link_libraries(schemagen PRIVATE Boost::program_options)

0 commit comments

Comments
 (0)