CMakeSwiftInformation.cmake 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. if(UNIX)
  4. set(CMAKE_Swift_OUTPUT_EXTENSION .o)
  5. else()
  6. set(CMAKE_Swift_OUTPUT_EXTENSION .obj)
  7. endif()
  8. # Load compiler-specific information.
  9. if(CMAKE_Swift_COMPILER_ID)
  10. include(Compiler/${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
  11. if(CMAKE_SYSTEM_PROCESSOR)
  12. include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
  13. endif()
  14. include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
  15. endif()
  16. set(CMAKE_INCLUDE_FLAG_Swift "-I ")
  17. set(CMAKE_Swift_DEFINE_FLAG -D)
  18. set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")
  19. set(CMAKE_Swift_COMPILER_ARG1 -frontend)
  20. set(CMAKE_Swift_FLAGS_DEBUG_INIT "-g")
  21. set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
  22. set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
  23. set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
  24. # NOTE(compnerd) we do not have an object compile rule since we build the objects as part of the link step
  25. if(NOT CMAKE_Swift_COMPILE_OBJECT)
  26. set(CMAKE_Swift_COMPILE_OBJECT ":")
  27. endif()
  28. if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
  29. if(CMAKE_Swift_COMPILER_TARGET)
  30. set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
  31. else()
  32. set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
  33. endif()
  34. endif()
  35. if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
  36. set(CMAKE_Swift_CREATE_SHARED_MODULE ${CMAKE_Swift_CREATE_SHARED_LIBRARY})
  37. endif()
  38. if(NOT CMAKE_Swift_LINK_EXECUTABLE)
  39. if(CMAKE_Swift_COMPILER_TARGET)
  40. set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target <CMAKE_Swift_COMPILER_TARGET> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
  41. else()
  42. set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <FLAGS> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
  43. endif()
  44. endif()
  45. if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
  46. set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
  47. set(CMAKE_Swift_ARCHIVE_FINISH "")
  48. endif()
  49. set(CMAKE_Swift_INFORMATION_LOADED 1)