Skip to content

Commit

Permalink
Fix the clang build for clang 14 (#3927)
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 <[email protected]>

* Only add the flag for Clang 15 and newer.

Signed-off-by: Chris Lalancette <[email protected]>

---------

Signed-off-by: Chris Lalancette <[email protected]>
(cherry picked from commit 38820e9)

Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
mergify[bot] and clalancette committed Oct 17, 2023
1 parent f631faa commit bbf0e47
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 bbf0e47

Please sign in to comment.