Skip to content

Commit 0b78e5e

Browse files
committed
Silence compiler warnings from vendored BinDiff/BinExport code
Build the vendored trees and their fetched dependencies with `-w`, and mark the subtree `SYSTEM` so warnings in vendored headers included from the plugin's own sources are suppressed too. The plugin's sources keep the top-level warning flags.
1 parent 75a7124 commit 0b78e5e

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

plugins/bindiff_similarity/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
22

33
project(bindiff_similarity)
44

@@ -32,10 +32,21 @@ set(BINEXPORT_ENABLE_IDAPRO OFF CACHE BOOL "" FORCE)
3232
set(BINEXPORT_ENABLE_BINARYNINJA OFF CACHE BOOL "" FORCE)
3333
set(BINEXPORT_MSVC_STATIC_RUNTIME OFF CACHE BOOL "" FORCE)
3434

35+
# Suppress compiler warnings in the vendored bindiff/binexport trees and the
36+
# dependencies they fetch. The bindiff_similarity target captured the directory's
37+
# COMPILE_OPTIONS when it was created, so its own sources keep the top-level
38+
# warning flags.
39+
if (MSVC)
40+
add_compile_options(/w)
41+
else ()
42+
add_compile_options(-w)
43+
endif ()
44+
3545
add_subdirectory(
3646
"${CMAKE_CURRENT_LIST_DIR}/../../vendor/bindiff"
3747
"${CMAKE_CURRENT_BINARY_DIR}/vendor_bindiff"
3848
EXCLUDE_FROM_ALL
49+
SYSTEM
3950
)
4051

4152
target_link_libraries(${PROJECT_NAME}

vendor/bindiff

vendor/binexport

0 commit comments

Comments
 (0)