3
3
4
4
function (get_effective_platform_for_triple triple output )
5
5
string (FIND "${triple} " "macos" IS_MACOS )
6
- if (IS_MACOS )
6
+ if (NOT IS_MACOS EQUAL -1 )
7
7
set (${output} "" PARENT_SCOPE )
8
8
return ()
9
9
endif ()
10
- message (FATAL_ERROR "Not supported " )
10
+ message (FATAL_ERROR "Can not create an effective platform name for triple: ${triple} " )
11
11
endfunction ()
12
12
13
13
function (escape_path_for_xcode config path result_var_name )
@@ -27,35 +27,36 @@ endfunction()
27
27
28
28
function (check_imported_target_has_imported_configuration target config )
29
29
get_target_property (IMPORTED_CONFIGS_LIST ${target} IMPORTED_CONFIGURATIONS )
30
- if ("${IMPORTED_CONFIGS_LIST} " STREQUAL "NOTFOUND" )
30
+ if ("${IMPORTED_CONFIGS_LIST} " STREQUAL "IMPORTED_CONFIGS_LIST- NOTFOUND" )
31
31
message (FATAL_ERROR "No import configuration of ${target} specified?!" )
32
32
endif ()
33
33
34
- list (FIND "${IMPORTED_CONFIGS_LIST} " "${config} " FOUND_CONFIG )
35
- if (NOT FOUND_CONFIG )
36
- message (FATAL_ERROR "${target} does not have imported config '${config} '?! \
37
- Instead: ${IMPORTED_CONFIGS_LIST} " )
34
+ list (FIND IMPORTED_CONFIGS_LIST "${config} " FOUND_CONFIG )
35
+ if (FOUND_CONFIG EQUAL -1 )
36
+ message (FATAL_ERROR "${target} does not have imported config '${config} '?! Instead: ${IMPORTED_CONFIGS_LIST} " )
38
37
endif ()
39
38
endfunction ()
40
39
41
- function (fixup_imported_target_property_for_xcode target property real_build_type )
42
- set (FULL_PROP_NAME "${property} _${real_build_type } " )
40
+ function (fixup_imported_target_property_for_xcode target property llvm_build_type )
41
+ set (FULL_PROP_NAME "${property} _${llvm_build_type } " )
43
42
44
43
# First try to lookup the value associated with the "real build type".
45
44
get_target_property (PROP_VALUE ${target} ${FULL_PROP_NAME} )
46
45
47
46
# If the property is unspecified, return.
48
- if ("${PROP_VALUE} " STREQUAL "NOTFOUND" )
47
+ if ("${PROP_VALUE} " STREQUAL "PROP_VALUE- NOTFOUND" )
49
48
return ()
50
49
endif ()
51
50
52
51
# Otherwise for each cmake configuration that is not real_build_type, hardcode
53
52
# its value to be PROP_VALUE.
54
- foreach (c ${CMAKE_CONFIGURATION_TYPES} )
55
- if ("${c} " STREQUAL "${real_build_type} " )
53
+ foreach (build_type ${CMAKE_CONFIGURATION_TYPES} )
54
+ string (TOUPPER "${build_type} " build_type_upper )
55
+ if ("${build_type_upper} " STREQUAL "${llvm_build_type} " )
56
56
continue ()
57
57
endif ()
58
- set_target_properties (${target} PROPERTIES "${property} _${c} " "${PROP_VALUE} " )
58
+ set (SWIFT_BUILD_PROPERTY_NAME "${property} _${build_type_upper} " )
59
+ set_target_properties (${target} PROPERTIES "${SWIFT_BUILD_PROPERTY_NAME} " "${PROP_VALUE} " )
59
60
endforeach ()
60
61
endfunction ()
61
62
@@ -69,6 +70,8 @@ endfunction()
69
70
# compiled in, so we can grab the imported location for that configuration and
70
71
# splat it across the other configurations as well.
71
72
function (fix_imported_targets_for_xcode imported_targets )
73
+ string (TOUPPER "${LLVM_BUILD_TYPE} " LLVM_BUILD_TYPE_UPPER )
74
+
72
75
# This is the set of configuration specific cmake properties that are
73
76
# supported for imported targets in cmake 3.4.3. Sadly, beyond hacks, it seems
74
77
# that there is no way to dynamically query the list of set properties of a
@@ -93,12 +96,12 @@ function(fix_imported_targets_for_xcode imported_targets)
93
96
94
97
# First check that we actually imported the configuration that LLVM said
95
98
# that we did. This is just a sanity check.
96
- check_imported_target_has_imported_configuration (${target} ${LLVM_BUILD_TYPE } )
99
+ check_imported_target_has_imported_configuration (${target} ${LLVM_BUILD_TYPE_UPPER } )
97
100
98
101
# Then loop through all of the imported properties and translate.
99
- foreach (property ${imported_properties } )
102
+ foreach (property ${imported_target_properties } )
100
103
fixup_imported_target_property_for_xcode (
101
- ${target} ${property} ${LLVM_BUILD_TYPE } )
104
+ ${target} ${property} ${LLVM_BUILD_TYPE_UPPER } )
102
105
endforeach ()
103
106
endforeach ()
104
107
endfunction ()
0 commit comments