summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/config-ix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/cmake/config-ix.cmake')
-rw-r--r--compiler-rt/cmake/config-ix.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index ce77cdc8d54..06b57a35cc7 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -207,6 +207,32 @@ macro(get_test_cc_for_arch arch cc_out cflags_out)
endif()
endmacro()
+# Returns CFLAGS that should be used to run tests for the
+# specific apple platform and architecture.
+function(get_test_cflags_for_apple_platform platform arch cflags_out)
+ is_valid_apple_platform("${platform}" is_valid_platform)
+ if (NOT is_valid_platform)
+ message(FATAL_ERROR "\"${platform}\" is not a valid apple platform")
+ endif()
+ set(test_cflags "")
+ get_target_flags_for_arch(${arch} test_cflags)
+ list(APPEND test_cflags ${DARWIN_${platform}_CFLAGS})
+ string(REPLACE ";" " " test_cflags_str "${test_cflags}")
+ string(APPEND test_cflags_str "${COMPILER_RT_TEST_COMPILER_CFLAGS}")
+ set(${cflags_out} "${test_cflags_str}" PARENT_SCOPE)
+endfunction()
+
+function(is_valid_apple_platform platform is_valid_out)
+ set(is_valid FALSE)
+ if ("${platform}" STREQUAL "")
+ message(FATAL_ERROR "platform cannot be empty")
+ endif()
+ if ("${platform}" MATCHES "^(osx|((ios|watchos|tvos)(sim)?))$")
+ set(is_valid TRUE)
+ endif()
+ set(${is_valid_out} ${is_valid} PARENT_SCOPE)
+endfunction()
+
set(ARM64 aarch64)
set(ARM32 arm armhf)
set(HEXAGON hexagon)
OpenPOWER on IntegriCloud