| string( | |
| REGEX MATCHALL | |
| "swiftc(\\.exe)?\"? [^\n]* -emit-module-path [^\n]*L\\.swiftmodule" | |
| swift_module_commands "${actual_stdout}") | |
| set(emit_module_commands "${swift_module_commands}") | |
| list(FILTER emit_module_commands EXCLUDE REGEX " -c ") | |
| if(NOT emit_module_commands) | |
| string(APPEND RunCMake_TEST_FAILED | |
| "Expected an emit-module command with '-emit-module-path ... L.swiftmodule'.\n") | |
| endif() | |
| set(compile_commands "${swift_module_commands}") | |
| list(FILTER compile_commands INCLUDE REGEX " -c ") | |
| if(compile_commands) | |
| string(APPEND RunCMake_TEST_FAILED | |
| "Compile command (-c) should not contain '-emit-module-path' when emitting module separately.\n") | |
| endif() |