Detecting compiler if VS2010 or MinGW compiler is used.
-
Is there a way to detect in the .pro file which compiler is being used?
The MinGW compiler creates libABC.a files but VS2010 creates ABC.lib.
I want to support them both so i need i need a LIBS statement for MinGW and one for VS2010.
Alternative is to force VS2010 to generate libABC.a, but if i set this to the TARGET is creates a libABC.a.lib !! -
Hi and welcome to devnet,
Unless you are providing the full path to the library file when linking you don't need to do that.
@LIBS += -LC:/Path/To/lib_ABC_lib_file/ -lABC@
should be enough
-
Thnx, that works. But how about the libraries listed in the PRE_TARGETDEPS?
-
You can use scopes:
@
mingw {
PRE_TARGETDEPS += /path/to/my_lib/libABC.a
} else {
PRE_TARGETDEPS += /path/to/my_lib/ABC.lib
}
@