Fix usage of generator expressions for libcxx cmake

Before, if you store clickhouse sources in /src, there was a typo and it
produce the following error:

    CMake Error in contrib/libcxx-cmake/CMakeLists.txt:
      Target "cxx" INTERFACE_INCLUDE_DIRECTORIES property contains path:

        "/src"

      which is prefixed in the source directory.

Also move "src" into PRIVATE, since it is required only for libcxx
itself.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-09-02 14:15:18 +02:00
parent 963c0111bf
commit dd8478422a

View File

@ -54,9 +54,8 @@ set(SRCS
add_library(cxx ${SRCS})
set_target_properties(cxx PROPERTIES FOLDER "contrib/libcxx-cmake")
target_include_directories(cxx SYSTEM BEFORE PUBLIC
$<BUILD_INTERFACE:${LIBCXX_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${LIBCXX_SOURCE_DIR}>/src)
target_include_directories(cxx SYSTEM BEFORE PRIVATE $<BUILD_INTERFACE:${LIBCXX_SOURCE_DIR}/src>)
target_include_directories(cxx SYSTEM BEFORE PUBLIC $<BUILD_INTERFACE:${LIBCXX_SOURCE_DIR}/include>)
target_compile_definitions(cxx PRIVATE -D_LIBCPP_BUILDING_LIBRARY -DLIBCXX_BUILDING_LIBCXXABI)
# Enable capturing stack traces for all exceptions.