[libcxx][CMake] Set library dir when built under runtimes/
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Thu, 4 May 2017 06:02:50 +0000 (06:02 +0000)
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Thu, 4 May 2017 06:02:50 +0000 (06:02 +0000)
This will put libraries into the build root's lib/ directory by default.

Differential Revision: https://reviews.llvm.org/D32736

llvm-svn: 302117

libcxx/CMakeLists.txt

index b062609..8c25a0a 100644 (file)
@@ -344,7 +344,11 @@ set(LIBCXX_COMPILER    ${CMAKE_CXX_COMPILER})
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
-set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+if (LLVM_LIBRARY_OUTPUT_INTDIR)
+  set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+else()
+  set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+endif()
 file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})