File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,17 @@ if (NOT SWIFT_SUPPORTS_DISABLE_IMPLICIT_STRING_PROCESSING_MODULE_IMPORT)
44
44
$< $< COMPILE_LANGUAGE:Swift> :-disable-implicit-string-processing-module-import> )
45
45
endif ()
46
46
47
+ # Determine the module triple.
48
+ # FIXME: This is a hack. It's all a hack.
49
+ if (CMAKE_Swift_COMPILER_TARGET )
50
+ string (REGEX REPLACE "macosx[0-9]+([.][0-9]+)?" "macos" SWIFT_MODULE_TRIPLE
51
+ ${CMAKE_Swift_COMPILER_TARGET} )
52
+ elseif ("${CMAKE_SYSTEM_NAME} " STREQUAL "Windows" )
53
+ set (SWIFT_MODULE_TRIPLE "${CMAKE_SYSTEM_PROCESSOR} -unknown-windows-msvc" )
54
+ endif ()
55
+
56
+ message (STATUS "Module triple: ${SWIFT_MODULE_TRIPLE} " )
57
+
47
58
# Force single-threaded-only syntax trees to eliminate the Darwin
48
59
# dependency in the compiler.
49
60
add_compile_definitions (
Original file line number Diff line number Diff line change @@ -16,17 +16,12 @@ function(add_swift_host_library name)
16
16
# Add this to the list of exported targets.
17
17
set_property (GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS ${name} )
18
18
19
- # Determine the module triple based on the target triple.
20
- # FIXME: We would prefer to have build-script tell us.
21
- string (REGEX REPLACE "macosx[0-9]+([.][0-9]+)?" "macos" module_triple
22
- ${CMAKE_Swift_COMPILER_TARGET} )
23
-
24
19
# Determine where Swift modules will be built and installed.
25
20
set (module_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} )
26
21
set (module_base "${module_dir} /${name} .swiftmodule" )
27
- set (module_file "${module_base} /${module_triple } .swiftmodule" )
28
- set (module_interface_file "${module_base} /${module_triple } .swiftinterface" )
29
- set (module_sourceinfo_file "${module_base} /${module_triple } .swiftsourceinfo" )
22
+ set (module_file "${module_base} /${SWIFT_MODULE_TRIPLE } .swiftmodule" )
23
+ set (module_interface_file "${module_base} /${SWIFT_MODULE_TRIPLE } .swiftinterface" )
24
+ set (module_sourceinfo_file "${module_base} /${SWIFT_MODULE_TRIPLE } .swiftsourceinfo" )
30
25
31
26
# Add a custom target to create the module directory.
32
27
add_custom_command (
You can’t perform that action at this time.
0 commit comments