[libcxx-commits] [PATCH] D86920: [libcxxabi] Provide options to set compiler/link flags for test programs.

Hafiz Abid Qadeer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 1 02:28:46 PDT 2020


abidh created this revision.
abidh added reviewers: ldionne, mstorsjo, EricWF.
abidh added a project: libc++abi.
Herald added subscribers: libcxx-commits, dexonsmith, mgorny.
Herald added a reviewer: libc++abi.
abidh requested review of this revision.

Libunwind and libcxx have cmake variables to set the additional compiler and link flags needed to build a test program. The libcxxabi were missing those flags. This patch adds 'LIBCXXABI_TEST_LINKER_FLAGS' and 'LIBCXXABI_TEST_COMPILER_FLAGS' to fill this gap.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86920

Files:
  libcxxabi/CMakeLists.txt
  libcxxabi/test/lit.site.cfg.in


Index: libcxxabi/test/lit.site.cfg.in
===================================================================
--- libcxxabi/test/lit.site.cfg.in
+++ libcxxabi/test/lit.site.cfg.in
@@ -29,6 +29,8 @@
 config.sysroot                  = "@LIBCXXABI_SYSROOT@"
 config.gcc_toolchain            = "@LIBCXXABI_GCC_TOOLCHAIN@"
 config.cxx_ext_threads          = @LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@
+config.test_linker_flags        = "@LIBCXXABI_TEST_LINKER_FLAGS@"
+config.test_compiler_flags      = "@LIBCXXABI_TEST_COMPILER_FLAGS@"
 
 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
Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -87,6 +87,10 @@
 set(LIBCXXABI_TARGET_TRIPLE "" CACHE STRING "Target triple for cross compiling.")
 set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.")
 set(LIBCXXABI_SYSROOT "" CACHE PATH "Sysroot for cross compiling.")
+set(LIBCXXABI_TEST_LINKER_FLAGS "" CACHE STRING
+    "Additional linker flags for test programs.")
+set(LIBCXXABI_TEST_COMPILER_FLAGS "" CACHE STRING
+    "Additional compiler flags for test programs.")
 set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.")
 set(LIBCXXABI_LIBRARY_VERSION "1.0" CACHE STRING
 "Version of libc++abi. This will be reflected in the name of the shared \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86920.289105.patch
Type: text/x-patch
Size: 1570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200901/71b683c6/attachment.bin>


More information about the libcxx-commits mailing list