Skip to content

Commit

Permalink
disable all warnings for vendored perfetto.cc
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Pearson <[email protected]>
  • Loading branch information
cwpearson committed Jan 17, 2025
1 parent 82870a3 commit dc32e06
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions profiling/perfetto-connector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
kp_add_library(kp_perfetto_connector libperfetto-connector.cpp perfetto/perfetto.cc)
# perfetto/perfetto.cc is third-party code, so we want to disable all warnings for it
add_library(perfetto_static STATIC perfetto/perfetto.cc)
set_target_properties(perfetto_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# this is third-party code, so we just disable some errors that pop up
target_compile_options(kp_perfetto_connector PRIVATE -Wno-error=redundant-move)
target_compile_options(perfetto_static PRIVATE -w)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(perfetto_static PRIVATE /w)
endif()
target_include_directories(kp_perfetto_connector PRIVATE perfetto)

kp_add_library(kp_perfetto_connector libperfetto-connector.cpp)
target_link_libraries(kp_perfetto_connector PRIVATE perfetto_static)

# mark as system so we don't get warnings from perfetto.h either
target_include_directories(kp_perfetto_connector PRIVATE SYSTEM perfetto)

0 comments on commit dc32e06

Please sign in to comment.