diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index dd36b6163813..c20e5d1cc2a0 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -90,16 +90,17 @@ set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.") macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs) list(APPEND LIBCXX_CXX_FEATURE_FLAGS ${abidefines}) set(${abipathvar} "${${abipathvar}}" - CACHE STRINGS - "Paths to ABI include directories separate by ';'." + CACHE PATH + "Paths to C++ ABI header directories separated by ';'." FORCE ) set(LIBCXX_CXX_ABI_LIBRARIES ${abilibs}) set(LIBCXX_ABILIB_FILES ${abifiles}) + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include") foreach(_d ${abidirs}) file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}") endforeach() - set(LIBCXX_ABILIB_FILE_PATHS) + foreach(fpath ${LIBCXX_ABILIB_FILES}) set(found FALSE) foreach(incpath ${${abipathvar}}) @@ -107,29 +108,23 @@ macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs) set(found TRUE) get_filename_component(dstdir ${fpath} PATH) get_filename_component(ifile ${fpath} NAME) - add_custom_command( - OUTPUT "${CMAKE_BINARY_DIR}/include/${dstdir}/${ifile}" - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${incpath}/${fpath}" - "${CMAKE_BINARY_DIR}/include/${dstdir}" - MAIN_DEPENDENCY "${incpath}/${fpath}" - ) - list(APPEND LIBCXX_CXX_ABI_DEPS - "${CMAKE_BINARY_DIR}/include/${dstdir}/${ifile}" + file(COPY "${incpath}/${fpath}" + DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}" ) + list(APPEND abilib_headers "${CMAKE_BINARY_DIR}/include/${fpath}") endif() endforeach() if (NOT found) message(FATAL_ERROR "Failed to find ${fpath}") endif() endforeach() - add_custom_target(abilib_headers DEPENDS ${LIBCXX_CXX_ABI_DEPS}) - set(LIBCXX_CXX_ABI_DEPS abilib_headers) + + add_custom_target(LIBCXX_CXX_ABI_DEPS DEPENDS ${abilib_headers}) include_directories("${CMAKE_BINARY_DIR}/include") - install(DIRECTORY "${CMAKE_BINARY_DIR}/include/" + + install(FILES ${abilib_headers} DESTINATION include/c++/v1 - FILES_MATCHING - PATTERN "*" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) endmacro() @@ -181,6 +176,7 @@ if (MSVC) else() if (LIBCXX_HAS_NOSTDINCXX_FLAG) list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++) + string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG) list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x) diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index 0c88b7f23c97..bbf7ea42b37e 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -2,15 +2,12 @@ if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS) set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE) endif() -file(COPY . - DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1" +install(DIRECTORY . + DESTINATION include/c++/v1 FILES_MATCHING PATTERN "*" PATTERN "CMakeLists.txt" EXCLUDE PATTERN ".svn" EXCLUDE ${LIBCXX_SUPPORT_HEADER_PATTERN} - ) - -install(DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/" - DESTINATION include/c++/v1/ + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index cec0bee14311..70adcb722132 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -32,7 +32,7 @@ else() endif() if (DEFINED LIBCXX_CXX_ABI_DEPS) - add_dependencies(cxx ${LIBCXX_CXX_ABI_DEPS}) + add_dependencies(cxx LIBCXX_CXX_ABI_DEPS) endif() # Generate library list.