summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-01-16 20:47:35 +0000
committerEric Fiselier <eric@efcs.ca>2017-01-16 20:47:35 +0000
commit1cd196e7b46e49d170a4b4013879a577dee59cb2 (patch)
treeb4bf3d700396f35bff9e244339dc022f152b7fca /libcxx/cmake
parent87299ad2e793a2502ca2d7e46889ff3e8bbf2ebd (diff)
downloadbcm5719-llvm-1cd196e7b46e49d170a4b4013879a577dee59cb2.tar.gz
bcm5719-llvm-1cd196e7b46e49d170a4b4013879a577dee59cb2.zip
Improve CMake and LIT support for Windows
This patch contains multiple cleanups and fixes to better support building on Windows. * [Test] Fix handling of library runtime search paths by correctly adding them to the PATH variable when running the tests. * [Test] Don't explicitly force "--target=i686-pc-windows" when running the test suite. Clang++ seems to deduce the correct target. * [Test] Fix `.sh.cpp` tests on Windows by properly escaping flags used in shell commands. Specifically windows style paths which included spaces were causing these tests to fail. * [CMake] Add "vcruntime" to the list of supported C++ ABI libraries in CMake, and teach the test suite how to handle it. For now libc++ defaults to using "vcruntime" on Windows except when libc++abi is in tree; That is probably a bug and should be changed to always use vcruntime, at least for now. * [Misc] Move the "c++-build" include directory to the libc++ binary dir instead of the top level project dir and rename it "c++build". This is just misc cleanup. Libc++ shouldn't be creating internal build files and directories at the top-level projects root. * [Misc] Build type_info's destructor when building for MSVC. This is a temporary work around to prevent link errors until we have a proper type_info implementation. llvm-svn: 292157
Diffstat (limited to 'libcxx/cmake')
-rw-r--r--libcxx/cmake/Modules/HandleLibCXXABI.cmake14
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
index 4a6382b136b..182565f52d2 100644
--- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -18,6 +18,7 @@
# abidirs : A list of relative paths to create under an include directory
# in the libc++ build directory.
#
+
macro(setup_abi_lib abidefines abilib abifiles abidirs)
list(APPEND LIBCXX_COMPILE_FLAGS ${abidefines})
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_CXX_ABI_INCLUDE_PATHS}"
@@ -32,11 +33,10 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
set(LIBCXX_ABILIB_FILES ${abifiles})
# The place in the build tree where we store out-of-source headers.
- set(LIBCXX_BUILD_HEADERS_ROOT "${CMAKE_BINARY_DIR}/include/c++-build")
file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1")
foreach(_d ${abidirs})
- file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}/${_d}")
+ file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}/${_d}")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/${_d}")
endforeach()
@@ -48,19 +48,19 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
get_filename_component(dstdir ${fpath} PATH)
get_filename_component(ifile ${fpath} NAME)
file(COPY "${incpath}/${fpath}"
- DESTINATION "${LIBCXX_BUILD_HEADERS_ROOT}/${dstdir}"
+ DESTINATION "${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}"
)
file(COPY "${incpath}/${fpath}"
DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}"
)
if (LIBCXX_INSTALL_HEADERS)
- install(FILES "${LIBCXX_BUILD_HEADERS_ROOT}/${fpath}"
+ install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
DESTINATION include/c++/v1/${dstdir}
COMPONENT libcxx
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endif()
- list(APPEND abilib_headers "${LIBCXX_BUILD_HEADERS_ROOT}/${fpath}")
+ list(APPEND abilib_headers "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}")
endif()
endforeach()
if (NOT found)
@@ -68,7 +68,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endif()
endforeach()
- include_directories("${LIBCXX_BUILD_HEADERS_ROOT}")
+ include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
endmacro()
@@ -110,6 +110,8 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
setup_abi_lib("-DLIBCXXRT"
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
)
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "vcruntime")
+ # Nothing TODO
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
list(APPEND LIBCXX_COMPILE_FLAGS "-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default")
OpenPOWER on IntegriCloud