File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ endforeach()
3838
3939# Don't update the files in the source directory if no files were generated in the binary directory.
4040if (NOT FILE_NAMES)
41- message (FATAL_ERROR "Schema generation failed!" )
41+ message (FATAL_ERROR "Client generation failed!" )
4242endif ()
4343
4444 # Support if() IN_LIST operator: https://cmake.org/cmake/help/latest/policy/CMP0057.html
@@ -48,8 +48,10 @@ cmake_policy(SET CMP0057 NEW)
4848file (GLOB OLD_FILES ${CLIENT_SOURCE_DIR} /*.h ${CLIENT_SOURCE_DIR} /*.cpp)
4949foreach (OLD_FILE ${OLD_FILES} )
5050 get_filename_component (OLD_FILE ${OLD_FILE} NAME )
51- if (NOT OLD_FILE IN_LIST FILE_NAMES)
52- file (REMOVE "${CLIENT_SOURCE_DIR} /${OLD_FILE} " )
51+ if (NOT OLD_FILE IN_LIST FILE_NAMES AND
52+ NOT OLD_FILE STREQUAL "${CLIENT_PREFIX} Client.h" AND
53+ NOT OLD_FILE STREQUAL "${CLIENT_PREFIX} Client.cpp" )
54+ message (WARNING "Unexpected file in ${CLIENT_TARGET} client sources: ${OLD_FILE} " )
5355 endif ()
5456endforeach ()
5557
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ file(GLOB OLD_FILES ${SCHEMA_SOURCE_DIR}/*.h ${SCHEMA_SOURCE_DIR}/*.cpp)
4848foreach (OLD_FILE ${OLD_FILES} )
4949 get_filename_component (OLD_FILE ${OLD_FILE} NAME )
5050 if (NOT OLD_FILE IN_LIST FILE_NAMES)
51- file (REMOVE "${SCHEMA_SOURCE_DIR} /${OLD_FILE} " )
51+ if (OLD_FILE MATCHES "Object\\ .h$" OR OLD_FILE MATCHES "Object\\ .cpp$" )
52+ file (REMOVE "${SCHEMA_SOURCE_DIR} /${OLD_FILE} " )
53+ elseif (NOT OLD_FILE STREQUAL "${SCHEMA_PREFIX} Schema.h" AND
54+ NOT OLD_FILE STREQUAL "${SCHEMA_PREFIX} Schema.cpp" )
55+ message (WARNING "Unexpected file in ${SCHEMA_TARGET} GraphQL schema sources: ${OLD_FILE} " )
56+ endif ()
5257 endif ()
5358endforeach ()
5459
You can’t perform that action at this time.
0 commit comments