[Lldb-commits] [lldb] r147814 - /lldb/trunk/test/make/Makefile.rules
Greg Clayton
gclayton at apple.com
Mon Jan 9 16:00:16 PST 2012
Author: gclayton
Date: Mon Jan 9 18:00:15 2012
New Revision: 147814
URL: http://llvm.org/viewvc/llvm-project?rev=147814&view=rev
Log:
Update makefile rules to support C++ files in shared libraries and fix how
the linker driver is found.
Modified:
lldb/trunk/test/make/Makefile.rules
Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=147814&r1=147813&r2=147814&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Mon Jan 9 18:00:15 2012
@@ -69,7 +69,7 @@
cxx_compiler = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
# Function that returns the C++ linker, given $(CC) as arg.
-cxx_linker = $(if $(findstring clang,$(1)), $(subst clang,g++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,g++,$(1)), $(subst gcc,g++,$(1))))
+cxx_linker = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
#----------------------------------------------------------------------
# dylib settings
@@ -78,6 +78,11 @@
DYLIB_OBJECTS +=$(strip $(DYLIB_C_SOURCES:.c=.o))
endif
+ifneq "$(strip $(DYLIB_CXX_SOURCES))" ""
+ DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o))
+ CXX = $(call cxx_compiler,$(CC))
+ LD = $(call cxx_linker,$(CC))
+endif
#----------------------------------------------------------------------
# Check if we have any C source files
More information about the lldb-commits
mailing list