Files
swift-mirror/utils/llvm-opt/CMakeLists.txt
Argyrios Kyrtzidis c5e3700150 [CMake] Use the correct path for opt when setting up llvm-opt, when using xcodebuild.
Otherwise the LLVMPasses tests fail with the wrong path for opt.

Swift SVN r22866
2014-10-21 19:06:34 +00:00

32 lines
968 B
CMake

if(CMAKE_CONFIGURATION_TYPES)
foreach(config ${CMAKE_CONFIGURATION_TYPES})
# Xcode support. See the CMakeLists.txt for the SwiftLLVMPasses library.
set(OPT ${PATH_TO_LLVM_BUILD}/${config}/bin/opt)
string(TOUPPER ${config} config_upper)
get_property(SWIFT_LLVM_DYLIB
TARGET SwiftLLVMPasses
PROPERTY "LOCATION_${config_upper}")
# Note: this won't work if the EFFECTIVE_PLATFORM_NAME isn't empty.
# Currently it always is on OS X.
string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" SWIFT_LLVM_DYLIB
"${SWIFT_LLVM_DYLIB}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/llvm-opt.in
${CMAKE_BINARY_DIR}/${config}/bin/llvm-opt
@ONLY)
endforeach()
else()
set(OPT ${PATH_TO_LLVM_BUILD}/bin/opt)
get_property(SWIFT_LLVM_DYLIB
TARGET SwiftLLVMPasses
PROPERTY LOCATION)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/llvm-opt.in
${CMAKE_BINARY_DIR}/${config}/bin/llvm-opt
@ONLY)
endif()