1
1
# This file contains cmake configuration specifically related to support for the
2
2
# Xcode generator in CMake.
3
3
4
- function (apply_xcode_substitutions config path result_var_name )
5
- # Hack to deal with the fact that paths contain the build-time
6
- # variables. Note that this fix is Xcode-specific.
7
- string (REPLACE "$(CONFIGURATION)" "${config} " result "${path} " )
8
- string (REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" result "${result} " )
9
-
10
- set ("${result_var_name} " "${result} " PARENT_SCOPE )
11
- endfunction ()
12
-
13
4
function (get_effective_platform_for_triple triple output )
14
5
string (FIND "${triple} " "macos" IS_MACOS )
15
6
if (IS_MACOS )
@@ -19,23 +10,19 @@ function(get_effective_platform_for_triple triple output)
19
10
message (FATAL_ERROR "Not supported" )
20
11
endfunction ()
21
12
22
- # Eliminate $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) from a path.
23
- #
24
- # We do not support compiling llvm with an Xcode setting beyond the one that was
25
- # used with build-script. This allows us to remove those paths. Right now,
26
- # nothing here is tested for cross compiling with Xcode, but it is in principal
27
- # possible.
28
- function (escape_llvm_path_for_xcode path outvar )
29
- # First check if we are using Xcode. If not, return early.
13
+ function (escape_path_for_xcode config path result_var_name )
14
+ # If we are not using the Xcode generator, be defensive and early exit.
30
15
if (NOT XCODE )
31
- set (${outvar } "${path} " PARENT_SCOPE )
16
+ set (${result_var_name } "${path} " PARENT_SCOPE )
32
17
return ()
33
18
endif ()
34
19
35
20
get_effective_platform_for_triple ("${SWIFT_HOST_TRIPLE} " SWIFT_EFFECTIVE_PLATFORM_NAME )
36
- string (REPLACE "$(CONFIGURATION)" "${LLVM_BUILD_TYPE} " path "${path} " )
37
- string (REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "${SWIFT_EFFECTIVE_PLATFORM_NAME} " path "${path} " )
38
- set (${outvar} "${path} " PARENT_SCOPE )
21
+ # Hack to deal with the fact that paths contain the build-time
22
+ # variables. Note that this fix is Xcode-specific.
23
+ string (REPLACE "$(CONFIGURATION)" "${config} " result "${path} " )
24
+ string (REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "${SWIFT_EFFECTIVE_PLATFORM_NAME} " result "${result} " )
25
+ set ("${result_var_name} " "${result} " PARENT_SCOPE )
39
26
endfunction ()
40
27
41
28
function (get_imported_library_prefix outvar target prefix )
0 commit comments