-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable all warnings for vendored perfetto.cc
Signed-off-by: Carl Pearson <[email protected]>
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |