I would like to make a project file that would work both with msvc and gcc.
For instances, to optimize for speed you would do cl /O2
and g++ -O3
.
But I don't know how to tell the project file to make the difference. I would like something like :
msvc:QMAKE_CXXFLAGS_RELEASE += /O2 /openmp /arch:AVX
else:QMAKE_CXXFLAGS_RELEASE += -O3 -march=native -fopenmp -D_GLIBCXX_PARALLEL
which doesn't work sadly.
Other way would be to change the mkspecs and bundle the new ones with my app, but it is not very portable. Thanks !
Jean, to be precise, you should use this based on your description:
msvc:QMAKE_CXXFLAGS_RELEASE += /O2 /openmp /arch:AVX
gcc:QMAKE_CXXFLAGS_RELEASE += -O3 -march=native -fopenmp -D_GLIBCXX_PARALLEL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With