Add a Swift backend for LibertyXDR

This commit is contained in:
2023-06-15 09:42:06 +02:00
parent 8466d0d850
commit 53197b51e5
5 changed files with 298 additions and 12 deletions

View File

@@ -72,7 +72,7 @@ add_test (test-cmake-parser
# Test protocol code generation
set (lxdrgen_outputs)
set (lxdrgen_base "${PROJECT_BINARY_DIR}/lxdrgen.lxdr")
foreach (backend c go mjs)
foreach (backend c go mjs swift)
list (APPEND lxdrgen_outputs ${lxdrgen_base}.${backend})
add_custom_command (OUTPUT ${lxdrgen_base}.${backend}
COMMAND env LC_ALL=C awk
@@ -108,3 +108,11 @@ if (NODE_EXECUTABLE)
else ()
message (WARNING "Cannot test generated protocol code for Javascript")
endif ()
find_program (SWIFTC_EXECUTABLE swiftc)
if (SWIFTC_EXECUTABLE)
add_test (test-lxdrgen-swift
${SWIFTC_EXECUTABLE} -typecheck ${lxdrgen_base}.swift)
else ()
message (WARNING "Cannot test generated protocol code for Swift")
endif ()