From 7ea08dd6d3565d9998d77faa46c35507c6fc46fe 2012-03-30 09:57:41 From: Jani Honkonen Date: 2012-03-30 09:57:41 Subject: [PATCH] Fix shadow build/jom.exe problems --- diff --git a/src/chartconfig_p.h b/src/chartconfig_p.h index d386763..49799f6 100644 --- a/src/chartconfig_p.h +++ b/src/chartconfig_p.h @@ -22,7 +22,15 @@ #define CHARTCONFIG_H_ #include "qchartglobal.h" +#ifdef Q_CC_MSVC +// There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. +// This is the case at least with shadow builds. +// http://qt-project.org/wiki/jom +const char *buildTime = __DATE__; +const char *gitHead = "unknown"; +#else #include "qchartversion_p.h" +#endif QTCOMMERCIALCHART_BEGIN_NAMESPACE diff --git a/src/qchartversion_p.h b/src/qchartversion_p.h deleted file mode 100644 index 3a1c7ed..0000000 --- a/src/qchartversion_p.h +++ /dev/null @@ -1 +0,0 @@ -const char *buildTime = "unknown" ; const char *gitHead = "unknown" ; diff --git a/src/src.pro b/src/src.pro index 4ee09f9..02d782a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -125,24 +125,36 @@ QMAKE_EXTRA_COMPILERS += install_build_public_headers \ install_build_private_headers \ -chartversion.target = $$PWD/qchartversion_p.h -unix:{ - chartversion.commands = @echo \ - "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \ - const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \ - > \ - $$chartversion.target; -}else{ - chartversion.commands = @echo \ - "const char *buildTime = \"%date%_%time%\" ; \ - const char *gitHead = \"unknown\" ; " \ - > \ - $$chartversion.target +!win32-msvc*: { + + # There is a problem with jom.exe currently. It does not seem to understand QMAKE_EXTRA_TARGETS properly. + # This is the case at least with shadow builds. + # http://qt-project.org/wiki/jom + + chartversion.target = $$PWD/qchartversion_p.h + + unix:{ + chartversion.commands = @echo \ + "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \ + const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \ + > \ + $$chartversion.target; + }else{ + chartversion.commands = @echo \ + "const char *buildTime = \"%date%_%time%\" ; \ + const char *gitHead = \"unknown\" ; " \ + > \ + $$chartversion.target + } + + chartversion.depends = $$HEADERS \ + $$SOURCES + + PRE_TARGETDEPS += $$PWD/qchartversion_p.h + QMAKE_CLEAN += $$PWD/qchartversion_p.h + QMAKE_EXTRA_TARGETS += chartversion } -chartversion.depends = $$HEADERS \ - $$SOURCES -PRE_TARGETDEPS += $$PWD/qchartversion_p.h -QMAKE_EXTRA_TARGETS += chartversion + unix:QMAKE_DISTCLEAN += -r \ $$CHART_BUILD_HEADER_DIR \ $$CHART_BUILD_LIB_DIR