qmake: Test for current spec

佐手、 提交于 2019-12-01 18:02:19

问题


I would like to detect whether qmake is currently building using MingW (win32-gcc) or Visual Studio (win32-msvc200X).

At the moment I am using the following construct:

windows{
    contains(QMAKE_CC, gcc){
        # MingW
    }
    contains(QMAKE_CC, cl){
        # Visual Studio
    }
}

This does not seem particularly robust. Is there a better way?


回答1:


Probably not anymore robust, but different:

windows {
    *-g++* {
        # MinGW
    }
    *-msvc* {
        # MSVC
    }
}


来源:https://stackoverflow.com/questions/1741993/qmake-test-for-current-spec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!