From 237b6ed9e42742c3a74578220636b30b79b1fd06 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 19 Mar 2015 20:59:45 +0000 Subject: [PATCH] [libcxx] Unify LIBCXX__INCLUDE_PATHS to be LIBCXX_CXX_ABI_INCLUDE_PATHS Summary: Clean up all the different possible CMake options for specifying the ABI include paths into one CMake option named `LIBCXX_CXX_ABI_INCLUDE_PATHS`. The documentation has been updated to reflect this change. For the next week I have added explicit errors if any of the old flags is used. These errors inform users of the change and the new option to use. Before committing the change I will announce this change on cfe-dev. Reviewers: danalbert, mclow.lists Reviewed By: danalbert, mclow.lists Subscribers: jroelofs, cbergstrom, cfe-commits Differential Revision: http://reviews.llvm.org/D5039 llvm-svn: 232762 --- libcxx/CMakeLists.txt | 23 ++++++++++++++++++++++- libcxx/cmake/Modules/HandleLibCXXABI.cmake | 12 ++++++------ libcxx/www/index.html | 8 ++++---- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index bb80182..0737357 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -83,7 +83,7 @@ if (NOT LIBCXX_CXX_ABI) if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi") set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") - set(LIBCXX_LIBCXXABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include") + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include") set(LIBCXX_CXX_ABI_INTREE 1) else () set(LIBCXX_CXX_ABI_LIBNAME "none") @@ -95,6 +95,27 @@ set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING "Specify C++ ABI library to use." FORCE) set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) +# TODO(ericwf): Remove these options by March/25/2015. +# These CMake options have been removed in favor of a generic option +# "LIBCXX_CXX_ABI_INCLUDE_PATHS". Issue an explicit error message explaining +# the change for anybody that still uses them. +if (DEFINED LIBCXX_LIBCXXABI_INCLUDE_PATHS) + message(FATAL_ERROR + "The option \"LIBCXX_LIBCXXABI_INCLUDE_PATHS\" has been removed. " + "Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead " + "and clean your build directory.") +elseif(DEFINED LIBCXX_LIBSUPCXX_INCLUDE_PATHS) + message(FATAL_ERROR + "The option \"LIBCXX_LIBSUPCXX_INCLUDE_PATHS\" has been removed. " + "Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead " + "and clean your build directory.") +elseif(DEFINED LIBCXX_LIBCXXRT_INCLUDE_PATHS) + message(FATAL_ERROR + "The option \"LIBCXX_LIBCXXRT_INCLUDE_PATHS\" has been removed. " + "Use \"LIBCXX_CXX_ABI_INCLUDE_PATHS\" instead " + "and clean your build directory.") +endif() + #=============================================================================== # Configure System #=============================================================================== diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake index 960df9e..ac42697 100644 --- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -15,9 +15,9 @@ # abidirs : A list of relative paths to create under an include directory # in the libc++ build directory. # -macro(setup_abi_lib abipathvar abidefines abilib abifiles abidirs) +macro(setup_abi_lib abidefines abilib abifiles abidirs) list(APPEND LIBCXX_COMPILE_FLAGS ${abidefines}) - set(${abipathvar} "${${abipathvar}}" + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_CXX_ABI_INCLUDE_PATHS}" CACHE PATH "Paths to C++ ABI header directories separated by ';'." FORCE ) @@ -33,7 +33,7 @@ macro(setup_abi_lib abipathvar abidefines abilib abifiles abidirs) foreach(fpath ${LIBCXX_ABILIB_FILES}) set(found FALSE) - foreach(incpath ${${abipathvar}}) + foreach(incpath ${LIBCXX_CXX_ABI_INCLUDE_PATHS}) if (EXISTS "${incpath}/${fpath}") set(found TRUE) get_filename_component(dstdir ${fpath} PATH) @@ -71,7 +71,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR set(_LIBSUPCXX_DEFINES "") set(_LIBSUPCXX_LIBNAME supc++) endif() - setup_abi_lib("LIBCXX_LIBSUPCXX_INCLUDE_PATHS" + setup_abi_lib( "-D__GLIBCXX__ ${_LIBSUPCXX_DEFINES}" "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits" ) @@ -88,11 +88,11 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi") # Assume c++abi is installed in the system, rely on -lc++abi link flag. set(CXXABI_LIBNAME "c++abi") endif() - setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" "" + setup_abi_lib("" ${CXXABI_LIBNAME} "cxxabi.h;__cxxabi_config.h" "" ) elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt") - setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT" + setup_abi_lib("-DLIBCXXRT" "cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" "" ) elseif (NOT "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none") diff --git a/libcxx/www/index.html b/libcxx/www/index.html index c608183..c216176 100644 --- a/libcxx/www/index.html +++ b/libcxx/www/index.html @@ -201,7 +201,7 @@
  • cd libcxx
  • mkdir build && cd build
  • cmake -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_LIBCXXABI_INCLUDE_PATHS=path/to/libcxxabi/include + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include -DLIT_EXECUTABLE=path/to/llvm/utils/lit/lit.py .. # Linux may require -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  • make
  • @@ -373,7 +373,7 @@ End of search list.