Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with new clang #86

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions librviz_tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ link_directories(${catkin_LIBRARY_DIRS})
## This setting causes Qt's "MOC" generation to happen automatically.
set(CMAKE_AUTOMOC ON)

if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL "11")
# newer Clang chokes on the idiomatic way to use CF_ENUM; e.g. like this:
# typedef CF_ENUM(int, MyEnum) {
# MY_ENUM_THING,
# MY_ENUM_OTHER_THING,
# # etc...
# }
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-elaborated-enum-base -Wno-undef-prefix")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-elaborated-enum-base -Wno-undef-prefix")
SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wno-undef-prefix")
endif()

## This plugin includes Qt widgets, so we must include Qt.
## We'll use the version that rviz used so they are compatible.
if(rviz_QT_VERSION VERSION_LESS "5")
Expand Down
12 changes: 12 additions & 0 deletions rviz_plugin_tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ catkin_package()
include_directories(${catkin_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS})

if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL "11")
# newer Clang chokes on the idiomatic way to use CF_ENUM; e.g. like this:
# typedef CF_ENUM(int, MyEnum) {
# MY_ENUM_THING,
# MY_ENUM_OTHER_THING,
# # etc...
# }
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-elaborated-enum-base -Wno-undef-prefix")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-elaborated-enum-base -Wno-undef-prefix")
SET(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wno-undef-prefix")
endif()

## This setting causes Qt's "MOC" generation to happen automatically.
set(CMAKE_AUTOMOC ON)

Expand Down