diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-25 06:34:33 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-25 06:34:33 +0000 |
commit | c90171961d020d93e4ce548016d8ccb8aab00c57 (patch) | |
tree | 639ac8f1a8273a2563895bed7d55bd60fbff5f46 /unittests | |
parent | e6ba0b576231ad3af599d1985dad370e59d954f9 (diff) | |
download | external_llvm-c90171961d020d93e4ce548016d8ccb8aab00c57.zip external_llvm-c90171961d020d93e4ce548016d8ccb8aab00c57.tar.gz external_llvm-c90171961d020d93e4ce548016d8ccb8aab00c57.tar.bz2 |
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
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Makefile.unittest | 11 |
1 files changed, 10 insertions, 1 deletions
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 |