CMake uses C++-specific options for C files too (Issue #22696)

364 views
Skip to first unread message

VZ

unread,
Aug 3, 2022, 12:20:29 PM8/3/22
to wx-...@googlegroups.com, Subscribed

Doing

$ cmake -S . -B ~/build/wx/cmake -GNinja

$ cmake --build ~/build/wx/cmake

results in the following output

[2/794] Building C object libs/base/CMakeFiles/wxbase.dir/__/__/__/__/src/common/extended.c.o

cc1: warning: command-line option ‘-Wno-ctor-dtor-privacy’ is valid for C++/ObjC++ but not for C

cc1: warning: command-line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C

[5/794] Building C object libs/core/CMakeFiles/wxcore.dir/__/__/__/__/src/gtk/treeentry_gtk.c.o

cc1: warning: command-line option ‘-Wno-ctor-dtor-privacy’ is valid for C++/ObjC++ but not for C

cc1: warning: command-line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C

It's harmless, but it would be nice if we could avoid these warnings by using separate C and C++ warning options.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22696@github.com>

Maarten

unread,
Aug 4, 2022, 2:04:02 PM8/4/22
to wx-...@googlegroups.com, Subscribed

This can be fixed by adding those warnings only for CXX compiler, like: $<$<COMPILE_LANGUAGE:CXX>:${cpp_only_warnings}>

I'll create a PR with this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22696/1205596747@github.com>

VZ

unread,
Aug 14, 2022, 10:53:27 AM8/14/22
to wx-...@googlegroups.com, Subscribed

I think this should be safe to backport to 3.2, shouldn't it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22696/1214394974@github.com>

Maarten

unread,
Aug 17, 2022, 6:56:27 PM8/17/22
to wx-...@googlegroups.com, Subscribed

Yes, this can be backported.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22696/1218578505@github.com>

VZ

unread,
Aug 18, 2022, 1:05:23 PM8/18/22
to wx-...@googlegroups.com, Subscribed

Thanks, I've actually already done it and forgot to close this (it's really inconvenient not to be able to use Closes #NNNN in 3.2 branch).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22696/1219729260@github.com>

VZ

unread,
Aug 18, 2022, 1:05:23 PM8/18/22
to wx-...@googlegroups.com, Subscribed

Closed #22696 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/22696/issue_event/7216080315@github.com>

Reply all
Reply to author
Forward
0 new messages