Fix EventPipe source using COMPILE_OPTIONS on old CMake 3.6.2.#48809
Conversation
Older CMake < 3.11 doesn't include COMPILE_OPTIONS source file property. This property is needed by clang or it will issue warning when building files with .c extension under c++ compiler. Fallback to add_compile_options if CMake is older than 3.11. Even if that option has wider scope, this is only applied to files in eventpipe directory or in debug-pal. Keeping the more precise set_source_files_properties on newer CMake and when we can upgrade CMake to 3.11 or newer we could get rid of this.
|
Tagging subscribers to this area: @tommcdon Issue DetailsOlder CMake < 3.11 doesn't include COMPILE_OPTIONS source file property. This property is needed by clang or it will issue warning when building files with .c extension under c++ compiler. Fallback to add_compile_options if CMake is older than 3.11. Even if that option has wider scope, this is only applied to files in eventpipe directory or in debug-pal. Keeping the more precise set_source_files_properties on newer CMake and when we can upgrade CMake to 3.11 or newer we could get rid of this.
|
hoyosjs
left a comment
There was a problem hiding this comment.
LGTM
Keeping the more precise set_source_files_properties on newer CMake and when we can upgrade CMake to 3.11 or newer we could get rid of this.
Yes, necessary sadness of leaving the feature out to ensure we have wide platform reach for official distribution builds. Thanks for testing the fix, I tried on centos8 earlier with the PowerTools enabled, but looks like they are already on 3.11.4. Then tested against the source-build image in centos7 which has cmake-3.6.2 and the generated command has -xc++ as expected.
Older CMake < 3.11 doesn't include COMPILE_OPTIONS source file property. This property is needed by clang or it will issue warning (causing build error) when building files with .c extension under c++ compiler.
Fallback to add_compile_options if CMake is older than 3.11. Even if that option has wider scope, this is only applied to files in eventpipe directory or in debug-pal.
Keeping the more precise set_source_files_properties on newer CMake and when we can upgrade CMake to 3.11 or newer we could get rid of this.