[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 05:14:55 PDT 2024


================
@@ -418,11 +437,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB))
 	endif
 endif
 
+# No C++ library has been specifieed. Use libstdc++ by default.
+ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB)))
+  # If no explicit request was made, but we have paths to a custom libcxx, use
+  # them.
+  ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),)
+    CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR)
+    ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
+      CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
+    endif
+    LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi
+  # Otherwise no C++ library has been specified. Use stdc++ by default.
+  else
+    USE_LIBSTDCPP := 1
----------------
labath wrote:

this default doesn't make sense for darwin and windows builds. Could we default to the system library instead?

https://github.com/llvm/llvm-project/pull/99266


More information about the lldb-commits mailing list