From c90171961d020d93e4ce548016d8ccb8aab00c57 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Thu, 25 Feb 2010 06:34:33 +0000 Subject: Try r96559 for the third time. This time the shared library is only built if --enable-shared is passed to configure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97119 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Makefile.unittest | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'unittests') diff --git a/unittests/Makefile.unittest b/unittests/Makefile.unittest index 6fbef54..b1c1d2c 100644 --- a/unittests/Makefile.unittest +++ b/unittests/Makefile.unittest @@ -28,6 +28,15 @@ CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ CPP.Flags += $(NO_VARIADIC_MACROS) TESTLIBS = -lGoogleTest -lUnitTestMain +ifeq ($(ENABLE_SHARED), 1) + # Add the absolute path to the dynamic library. This is ok because + # we'll never install unittests. + LD.Flags += $(RPATH) -Wl,$(LibDir) + # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most + # of the time. + Run.Shared := $(SHLIBPATH_VAR)="$(LibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)" +endif + $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(Echo) Linking $(BuildMode) unit test $(TESTNAME) $(StripWarnMsg) $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ @@ -38,6 +47,6 @@ $(LLVMUnitTestExe): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) all:: $(LLVMUnitTestExe) unitcheck:: $(LLVMUnitTestExe) - $(LLVMUnitTestExe) + $(Run.Shared) $(LLVMUnitTestExe) endif -- cgit v1.1