If either the LLVM_INSTALL_DIR environment variable or the qmake
variable are set, use that to find the llvm-config utility. Changing
those is easier than modifying your path. Can be used if you have more
than one LLVM installation installed.
Change-Id: I24265b397e21f468ece61392a112de9a50c67c5a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
CONFIG -= app_bundle
CONFIG += console
+LLVM_CONFIG=llvm-config
+
+# Pick up the qmake variable or environment variable for LLVM_INSTALL_DIR. If either was set, change the LLVM_CONFIG to use that.
+isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR)
+!isEmpty(LLVM_INSTALL_DIR):LLVM_CONFIG=$$LLVM_INSTALL_DIR/bin/llvm-config
+
LIBS += -rdynamic
SOURCES += main.cpp \
qv4isel_llvm_p.h
INCLUDEPATH += \
- $$system(llvm-config --includedir)
+ $$system($$LLVM_CONFIG --includedir)
DEFINES += \
__STDC_CONSTANT_MACROS \
__STDC_LIMIT_MACROS
LIBS += \
- $$system(llvm-config --ldflags) \
- $$system(llvm-config --libs core jit bitreader linker ipo target x86 arm)
+ $$system($$LLVM_CONFIG --ldflags) \
+ $$system($$LLVM_CONFIG --libs core jit bitreader linker ipo target x86 arm)
QMAKE_EXTRA_TARGETS += gen_llvm_runtime