[libcxx] Use joined format for include flag on Windows
authorPetr Hosek <phosek@google.com>
Thu, 29 Apr 2021 17:11:39 +0000 (10:11 -0700)
committerPetr Hosek <phosek@google.com>
Fri, 30 Apr 2021 18:40:30 +0000 (11:40 -0700)
Without this, CMake deduplicates the /I flag breaking the build. See
https://cmake.org/cmake/help/v3.13/command/target_compile_options.html
for more details on why this is needed.

Differential Revision: https://reviews.llvm.org/D101550

libcxx/include/CMakeLists.txt

index 18fec97..79981c5 100644 (file)
@@ -231,8 +231,8 @@ add_library(cxx-headers INTERFACE)
 add_dependencies(cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})
 # TODO: Use target_include_directories once we figure out why that breaks the runtimes build
 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
-  target_compile_options(cxx-headers INTERFACE /I "${LIBCXX_GENERATED_INCLUDE_DIR}"
-                                     INTERFACE /I "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}")
+  target_compile_options(cxx-headers INTERFACE /I${LIBCXX_GENERATED_INCLUDE_DIR}
+                                     INTERFACE /I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})
 else()
   target_compile_options(cxx-headers INTERFACE -I${LIBCXX_GENERATED_INCLUDE_DIR}
                                      INTERFACE -I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})