QMAKE_CXXFLAGS does not require any particular values, your C++ compiler does.
Similarly, QMAKE_LFAGS contains options needed by your linker.
This project file is attempting to cater for different environments in which it may be built and the different syntax/requirement of the compiler and linker. In this specific case it turns on compiler and linker support for OpenMP. The details of the switches accepted by your compiler/linker will be in their documentation. Whether you need them or not is driven by your project.
# This structure is called a scope in the qmake manual. It functions a little like an if-then-else statement.
# vvvvvvvvvvvvvvv
win32:!win32-g++{ # On the Windows platform (win32) and not (!) using the GNU compiler (win32-g++)
QMAKE_CXXFLAGS += -openmp # pass this option to the C++ compiler when compiling files
QMAKE_LFLAGS += -openmp # and pass this option to the linker when linking the project
} else { # On Windows with the GNU compiler and all other platforms (assuming GNU compiler)
QMAKE_CXXFLAGS+= -fopenmp # and pass this option to the linker when linking the project
QMAKE_LFLAGS += -fopenmp and pass this option to the linker when linking the project
}
# This structure is called a scope in the qmake manual. It functions a little like an if-then-else statement.
# vvvvvvvvvvvvvvv
win32:!win32-g++{ # On the Windows platform (win32) and not (!) using the GNU compiler (win32-g++)
QMAKE_CXXFLAGS += -openmp # pass this option to the C++ compiler when compiling files
QMAKE_LFLAGS += -openmp # and pass this option to the linker when linking the project
} else { # On Windows with the GNU compiler and all other platforms (assuming GNU compiler)
QMAKE_CXXFLAGS+= -fopenmp # and pass this option to the linker when linking the project
QMAKE_LFLAGS += -fopenmp and pass this option to the linker when linking the project
}
To copy to clipboard, switch view to plain text mode
Bookmarks