Permalink
Browse files

Add support for SC_GIT_REV to qmake-based build

[ci skip]
  • Loading branch information...
1 parent 833b771 commit f2ebc64d697dc8c6de361ff67235f0badda68acf @navv1234 navv1234 committed Aug 11, 2016
Showing with 14 additions and 1 deletion.
  1. +1 −1 lib/lib.pro
  2. +13 −0 simulationcraft.pri
View
@@ -16,7 +16,7 @@ ENV_APIKEY=$$(SC_DEFAULT_APIKEY)
}
!isEmpty(SC_DEFAULT_APIKEY) {
- DEFINES += SC_DEFAULT_APIKEY=\"$${SC_DEFAULT_APIKEY}\"
+ DEFINES += SC_DEFAULT_APIKEY=\\\"$${SC_DEFAULT_APIKEY}\\\"
}
# On Linux compilation, setup the profile search directory
View
@@ -42,6 +42,12 @@ contains(QMAKE_CXX, clang++)|contains(QMAKE_CXX, g++) {
}
}
+unix|macx {
+ system(which -s git) {
+ DEFINES += SC_GIT_REV="\\\"$$system(git rev-parse --short HEAD)\\\""
+ }
+}
+
macx {
contains(QMAKE_CXX, clang++) {
QMAKE_CXXFLAGS += -Wno-inconsistent-missing-override
@@ -55,6 +61,11 @@ win32 {
QMAKE_CXXFLAGS_RELEASE += /Ot /MP
}
+ # TODO: Mingw might want something more unixy here?
+ system(where /q git) {
+ DEFINES += SC_GIT_REV="\\\"$$system(git rev-parse --short HEAD)\\\""
+ }
+
!isEmpty(PGO) {
win32-msvc2013 {
QMAKE_LFLAGS_RELEASE += /LTCG
@@ -67,3 +78,5 @@ win32 {
}
}
}
+
+

0 comments on commit f2ebc64

Please sign in to comment.