0

My goal is to add my Qt project to a Jenkins buildserver, for nightly builds. Therefore I want to compile my project from the command line. I copied the buildsteps located in the build configuration:

 "/opt/fslc-x11/2.5/sysroots/x86_64-fslcsdk-linux/usr/bin/qt5/qmake" "/home/xxxx/repositories/xxx/xxx.pro" -spec linux-oe-g++ && /usr/bin/make qmake_all
 "/usr/bin/make"

I execute these commands in the build directory. The problem lies in the qmake command. The qmake command generates the makefile, but this makefile is different when I generate it in the command line instead of in QtCreator. The binary result after make is ofcourse very different.

It seems that the qmake command from the command line creates a debug makefile instead of a release makefile:

 CFLAGS        = -pipe  -02 -pipe -g -feliminate-unused-debug-types --sysroot=.........

The -02 -pipe -g -feliminate-unused-debug-types part is the only thing added when I run qmake in the command line (checked with diff).

I've tried the following:

  • Added CONFIG+=release to the qmake command
  • Added CONFIG-=DEBUG to the qmake command

Furthermore I've verified that the system environment and the terminal emulator is the same.

My question comes down to:

  1. Why does qmake add the (debug) flags when running from the command line?
  2. Does QtCreator add more to the environment that I might have missed?

Let me know if you need more information about the settings or the makefile that is generated.

Vincent Beltman
  • 2,064
  • 13
  • 27
  • I dont know the answer, but I had a similar problem and therefore I have added `CONFIG -= debug_and_release` and `CONFIG -= debug` and `CONFIG -= release` to my .pro file. After that I can add the target that I want and it always works as expected. – Benjamin Bihler Jan 10 '19 at 09:10
  • @BenjaminBihler Thanks for your comment, but unfortunately that did not work for me. – Vincent Beltman Jan 10 '19 at 10:02
  • By default `qmake`'s first (and so it becomes also `make`'s default) generated target is debug. Which is why `CONFIG+=release` or `make release` is usually needed. However, if it still doesn't help then look into your `share/qt5/mkspecs` directory. Probably some of .conf files are altered. Obviously, `-g` option should appear in `QMAKE_CFLAGS_DEBUG` only. – Matt Jan 10 '19 at 15:58

1 Answers1

0

Ok. So long story short: I've tried compiling for the local Linux distro with the standard qmake and my problem was solved.

It seems that problem lies at the custom qmake of the target (x86_64-fslcsdk-linux). I'm not gonna put more time in this issue, so feel free to add a more satisfying answer. I'll be happy to try it out :).

Vincent Beltman
  • 2,064
  • 13
  • 27