Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一种可移植的方式通过修改 .pro 文件将某些包含添加到属于 Qt 项目的所有 C++ 模块(就像我会使用该-include选项为 GCC 做的那样)?
-include
没有可移植的方法来做到这一点,因为每个编译器都应该被区别对待。
你能做的最好的事情就是写一堆条件句。例如
*-g++:QMAKE_CXXFLAGS += -include myheader.h else:*-msvc:QMAKE_CXXFLAGS += -Fi myheader.h # else:...