Files
swift-mirror/cmake/modules/SwiftDarwin.cmake
Dmitri Hrybenko 6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00

14 lines
571 B
CMake

# On Darwin platforms that have xcrun, returns the path to the
# default toolchain directory.
function(get_default_toolchain_dir result_var_name)
execute_process(
COMMAND "xcrun" "--toolchain" "default" "--find" "clang"
OUTPUT_VARIABLE toolchain_dir
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(toolchain_dir "${toolchain_dir}" PATH)
get_filename_component(toolchain_dir "${toolchain_dir}" PATH)
get_filename_component(toolchain_dir "${toolchain_dir}" PATH)
set("${result_var_name}" "${toolchain_dir}" PARENT_SCOPE)
endfunction()