Difference between COMPILE_FLAGS and COMPILE_OPTIONS

后端 未结 2 1998
我在风中等你
我在风中等你 2021-02-14 16:12

What is the difference between

COMPILE_FLAGS: Additional flags to use when compiling this target\'s sources.

and

2条回答
  •  花落未央
    2021-02-14 16:32

    COMPILE_OPTIONS is a list, but COMPILE_FLAGS is a string.

    set_target_properties(target PROPERTIES 
        COMPILE_OPTIONS "/option=test1;/option2=test2")
    set_target_properties(target PROPERTIES 
        COMPILE_FLAGS "/option=test1 /option2=test2")
    

    You can more-easily append to a list than to a string.

    Also, COMPILE_OPTIONS is properly escaped, whereas some characters in COMPILE_FLAGS may need to be escaped manually or cause problems.

提交回复
热议问题