eliminate install of duplicate headers (take 2)
Patch by Ryuta Suzuki git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -90,16 +90,17 @@ set(LIBCXX_TARGET_TRIPLE ${LIBCXX_TARGET_TRIPLE} CACHE STRING "Target triple.")
|
|||||||
macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs)
|
macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs)
|
||||||
list(APPEND LIBCXX_CXX_FEATURE_FLAGS ${abidefines})
|
list(APPEND LIBCXX_CXX_FEATURE_FLAGS ${abidefines})
|
||||||
set(${abipathvar} "${${abipathvar}}"
|
set(${abipathvar} "${${abipathvar}}"
|
||||||
CACHE STRINGS
|
CACHE PATH
|
||||||
"Paths to ABI include directories separate by ';'."
|
"Paths to C++ ABI header directories separated by ';'." FORCE
|
||||||
)
|
)
|
||||||
set(LIBCXX_CXX_ABI_LIBRARIES ${abilibs})
|
set(LIBCXX_CXX_ABI_LIBRARIES ${abilibs})
|
||||||
set(LIBCXX_ABILIB_FILES ${abifiles})
|
set(LIBCXX_ABILIB_FILES ${abifiles})
|
||||||
|
|
||||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
|
||||||
foreach(_d ${abidirs})
|
foreach(_d ${abidirs})
|
||||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}")
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}")
|
||||||
endforeach()
|
endforeach()
|
||||||
set(LIBCXX_ABILIB_FILE_PATHS)
|
|
||||||
foreach(fpath ${LIBCXX_ABILIB_FILES})
|
foreach(fpath ${LIBCXX_ABILIB_FILES})
|
||||||
set(found FALSE)
|
set(found FALSE)
|
||||||
foreach(incpath ${${abipathvar}})
|
foreach(incpath ${${abipathvar}})
|
||||||
@@ -107,29 +108,23 @@ macro(setup_abi_lib abipathvar abidefines abilibs abifiles abidirs)
|
|||||||
set(found TRUE)
|
set(found TRUE)
|
||||||
get_filename_component(dstdir ${fpath} PATH)
|
get_filename_component(dstdir ${fpath} PATH)
|
||||||
get_filename_component(ifile ${fpath} NAME)
|
get_filename_component(ifile ${fpath} NAME)
|
||||||
add_custom_command(
|
file(COPY "${incpath}/${fpath}"
|
||||||
OUTPUT "${CMAKE_BINARY_DIR}/include/${dstdir}/${ifile}"
|
DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}"
|
||||||
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}"
|
|
||||||
)
|
)
|
||||||
|
list(APPEND abilib_headers "${CMAKE_BINARY_DIR}/include/${fpath}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
if (NOT found)
|
if (NOT found)
|
||||||
message(FATAL_ERROR "Failed to find ${fpath}")
|
message(FATAL_ERROR "Failed to find ${fpath}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
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")
|
include_directories("${CMAKE_BINARY_DIR}/include")
|
||||||
install(DIRECTORY "${CMAKE_BINARY_DIR}/include/"
|
|
||||||
|
install(FILES ${abilib_headers}
|
||||||
DESTINATION include/c++/v1
|
DESTINATION include/c++/v1
|
||||||
FILES_MATCHING
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
PATTERN "*"
|
|
||||||
)
|
)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@@ -181,6 +176,7 @@ if (MSVC)
|
|||||||
else()
|
else()
|
||||||
if (LIBCXX_HAS_NOSTDINCXX_FLAG)
|
if (LIBCXX_HAS_NOSTDINCXX_FLAG)
|
||||||
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++)
|
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++)
|
||||||
|
string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG)
|
if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG)
|
||||||
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x)
|
list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x)
|
||||||
|
@@ -2,15 +2,12 @@ if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
|
|||||||
set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
|
set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(COPY .
|
install(DIRECTORY .
|
||||||
DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
|
DESTINATION include/c++/v1
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*"
|
PATTERN "*"
|
||||||
PATTERN "CMakeLists.txt" EXCLUDE
|
PATTERN "CMakeLists.txt" EXCLUDE
|
||||||
PATTERN ".svn" EXCLUDE
|
PATTERN ".svn" EXCLUDE
|
||||||
${LIBCXX_SUPPORT_HEADER_PATTERN}
|
${LIBCXX_SUPPORT_HEADER_PATTERN}
|
||||||
)
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
|
|
||||||
install(DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/"
|
|
||||||
DESTINATION include/c++/v1/
|
|
||||||
)
|
)
|
||||||
|
@@ -32,7 +32,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED LIBCXX_CXX_ABI_DEPS)
|
if (DEFINED LIBCXX_CXX_ABI_DEPS)
|
||||||
add_dependencies(cxx ${LIBCXX_CXX_ABI_DEPS})
|
add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Generate library list.
|
# Generate library list.
|
||||||
|
Reference in New Issue
Block a user