[libcxx-commits] [libcxx] r368284 - [pstl] Add a __pstl_config_site header to record the CMake configuration

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 8 05:43:05 PDT 2019


Author: ldionne
Date: Thu Aug  8 05:43:04 2019
New Revision: 368284

URL: http://llvm.org/viewvc/llvm-project?rev=368284&view=rev
Log:
[pstl] Add a __pstl_config_site header to record the CMake configuration

This commit adds a __pstl_config_site header that contains the value of
macros specified at CMake configuration time. It works similarly to
libc++'s __config_site header, except we always include it as a separate
file instead of concatenating it to the main configuration header.

It is necessary to thread the includes for that header into libc++'s
lit configuration, otherwise we'd be requiring an installation step
prior to running the test suite.

Modified:
    libcxx/trunk/test/lit.site.cfg.in
    libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=368284&r1=368283&r2=368284&view=diff
==============================================================================
--- libcxx/trunk/test/lit.site.cfg.in (original)
+++ libcxx/trunk/test/lit.site.cfg.in Thu Aug  8 05:43:04 2019
@@ -33,7 +33,8 @@ config.use_libatomic            = @LIBCX
 config.debug_build              = @LIBCXX_DEBUG_BUILD@
 config.libcxxabi_shared         = @LIBCXXABI_ENABLE_SHARED@
 config.cxx_ext_threads          = @LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY@
-config.pstl_root                = "@ParallelSTL_SOURCE_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
+config.pstl_src_root            = "@ParallelSTL_SOURCE_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
+config.pstl_obj_root            = "@ParallelSTL_BINARY_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
 
 # Let the main config do the real work.
 config.loaded_site_config = True

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=368284&r1=368283&r2=368284&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Thu Aug  8 05:43:04 2019
@@ -582,10 +582,12 @@ class Configuration(object):
         self.cxx.compile_flags += ['-I' + support_path]
 
         # Add includes for the PSTL headers
-        pstl_root = self.get_lit_conf('pstl_root')
-        if pstl_root is not None:
-            self.cxx.compile_flags += ['-I' + os.path.join(pstl_root, 'include')]
-            self.cxx.compile_flags += ['-I' + os.path.join(pstl_root, 'test')]
+        pstl_src_root = self.get_lit_conf('pstl_src_root')
+        pstl_obj_root = self.get_lit_conf('pstl_obj_root')
+        if pstl_src_root is not None and pstl_obj_root is not None:
+            self.cxx.compile_flags += ['-I' + os.path.join(pstl_src_root, 'include')]
+            self.cxx.compile_flags += ['-I' + os.path.join(pstl_obj_root, 'generated_headers')]
+            self.cxx.compile_flags += ['-I' + os.path.join(pstl_src_root, 'test')]
             self.config.available_features.add('parallel-algorithms')
 
         # FIXME(EricWF): variant_size.pass.cpp requires a slightly larger




More information about the libcxx-commits mailing list