3
我正在研究一個依賴於其他一些庫(特別是SFML和Box2D以及其他一些庫)的項目。我喜歡用我的警告運行起來,但我依賴的項目並不嚴格。我可以使用CMake編譯我的項目的不同部分,並提供不同的警告級別嗎?
有沒有一種方法可以用默認的警告設置編譯庫,並用我想要的警告標誌編譯我的代碼?我在CMakeLists.txt中有以下標誌列表。註釋掉的行是我現在無法打開的東西,因爲它們打破了我的依賴關係。
set(CUSTOM_CFLAGS ${CUSTON_CFLAGS}
-std=c++0x
#-ansi
-pedantic
-Werror
-Wall
-Wextra
#-Weffc++
-Wshadow
-Winit-self
-Wsign-promo
-Wcast-align
#-Wlogical-op
-Woverloaded-virtual
-Wno-unused-parameter
#-Wstrict-null-sentinel
-Wmissing-include-dirs
-Wframe-larger-than=8192
#-Wmissing-format-attribute
-g
#Would like this but Box2D hsa a ridiculous amount of it...
#-Wfloat-equal -Wno-error=float-equal
)