Skip to content

Commit

Permalink
Fix the clang build for clang 14 (#3923)
Browse files Browse the repository at this point in the history
* Fix the clang build for clang 14.

clang 14 does not understand -Wno-deprecated-builtins,
which causes problems trying to compile Fast-DDS on
Ubuntu 22.04

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

* Only add the flag for Clang 15 and newer.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>

---------

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 38820e9)
  • Loading branch information
clalancette authored and mergify[bot] committed Oct 11, 2023
1 parent f631faa commit 56693c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-builtins")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15,0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-builtins")
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl")
endif()

Expand Down

0 comments on commit 56693c7

Please sign in to comment.