llvm.org GIT mirror llvm / 6e53164
[cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX. For this to work, we have to encode it in the build variables and use it from llvm-config.cpp. I've tried to do this reasonably cleanly, but the code for llvm-config.cpp is pretty strange. However, with this, llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX. Note that the configure+make build just sets this to an empty string as that build system has zero support for multilib of any form. I'm not planning to add support there either, but this should leave a path for anyone that wanted to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224921 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
3 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2222 #define LLVM_LDFLAGS "@LLVM_LDFLAGS@"
2323 #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
2424 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
25 #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
2526 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
2627 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
5858 >> temp.sed
5959 $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \
6060 >> temp.sed
61 $(Verb) $(ECHO) 's/@LLVM_LIBDIR_SUFFIX@//' \
62 >> temp.sed
6163 $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LLVM_SYSTEM_LIBS))/' \
6264 >> temp.sed
6365 $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
242242 case MakefileStyle:
243243 ActivePrefix = ActiveObjRoot;
244244 ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin";
245 ActiveLibDir = ActiveObjRoot + "/" + build_mode + "/lib";
245 ActiveLibDir =
246 ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX;
246247 break;
247248 case CMakeStyle:
248249 ActiveBinDir = ActiveObjRoot + "/bin";
249 ActiveLibDir = ActiveObjRoot + "/lib";
250 ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
250251 break;
251252 case CMakeBuildModeStyle:
252253 ActivePrefix = ActiveObjRoot;
253254 ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
254 ActiveLibDir = ActiveObjRoot + "/lib/" + build_mode;
255 ActiveLibDir =
256 ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
255257 break;
256258 }
257259
262264 ActivePrefix = CurrentExecPrefix;
263265 ActiveIncludeDir = ActivePrefix + "/include";
264266 ActiveBinDir = ActivePrefix + "/bin";
265 ActiveLibDir = ActivePrefix + "/lib";
267 ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
266268 ActiveIncludeOption = "-I" + ActiveIncludeDir;
267269 }
268270