build_swifter_module.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. set -e
  3. # Build shared library for SQLite.
  4. echo "Building csqlite shared library...."
  5. clang -shared ../Sources/sqlite.c -o libcsqlite.so
  6. # Build Swifter Library
  7. SOURCES="
  8. ../Sources/File.swift \
  9. ../Sources/SQLite.swift \
  10. ../Sources/Reflection.swift \
  11. ../Sources/Process.swift \
  12. ../Sources/Socket.swift \
  13. ../Sources/String+Misc.swift \
  14. ../Sources/String+SHA1.swift \
  15. ../Sources/String+BASE64.swift \
  16. ../Sources/HttpRequest.swift \
  17. ../Sources/HttpResponse.swift \
  18. ../Sources/HttpServer.swift \
  19. ../Sources/HttpRouter.swift \
  20. ../Sources/HttpServerIO.swift \
  21. ../Sources/HttpParser.swift \
  22. ../Sources/HttpHandlers.swift \
  23. ../Sources/HttpHandlers+Files.swift \
  24. ../Sources/HttpHandlers+WebSockets.swift \
  25. "
  26. echo "Building Swifter library...."
  27. swiftc -emit-library -module-name Swifter $SOURCES -import-objc-header ../Sources/sqlite.h -lcsqlite -L.
  28. echo "Building Swifter module...."
  29. swiftc -emit-module -module-name Swifter $SOURCES -import-objc-header ../Sources/sqlite.h -lcsqlite -L. -I.
  30. echo "Done."