COMPILE_OPTIONS

在 3.11 版被加入.

要傳遞給編譯器的額外選項清單。

此屬性包含一個 分號分隔的清單 選項,並在建置此來源檔案時新增到編譯旗標清單中。這些選項將在目標範圍的選項之後新增。

Contents of COMPILE_OPTIONS may use generator expressions with the syntax $<...>. However, Xcode does not support per-config per-source settings, so expressions that depend on the build configuration are not allowed with that generator.

使用範例:

set_source_files_properties(foo.cpp PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter;-Wno-missing-field-initializer")

相關屬性:

相關命令: