Browse Source

fix: guard GCC-specific COMPILE_FLAGS in modemmeshcore with if (NOT MSVC)

The Monocypher vendored C files use -Wno-unused-function / -Wno-unused-parameter
compile flags that are GCC/Clang-only syntax. MSVC chokes on them with:

  cl : Command line error D8021 : invalid numeric argument '/Wno-unused-function'

Wrap the set_source_files_properties call in if (NOT MSVC) so the flags
are applied on macOS/Linux but skipped on Windows. The swagger CMakeLists.txt
uses the same pattern.
chirpmodem-v8.0.0
Tom Hensel 5 months ago
parent
commit
3036bbdccc
No known key found for this signature in database
  1. 8
      modemmeshcore/CMakeLists.txt

8
modemmeshcore/CMakeLists.txt

@ -33,9 +33,11 @@ add_library(modemmeshcore
# Vendored Monocypher (BSD-2-Clause OR CC0-1.0) is intentionally untouched; # Vendored Monocypher (BSD-2-Clause OR CC0-1.0) is intentionally untouched;
# silence sdrangel's strict-warning policy for the two .c files. # silence sdrangel's strict-warning policy for the two .c files.
set_source_files_properties(monocypher.c monocypher-ed25519.c if (NOT MSVC)
PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-unused-parameter" set_source_files_properties(monocypher.c monocypher-ed25519.c
) PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-unused-parameter"
)
endif()
target_link_libraries(modemmeshcore target_link_libraries(modemmeshcore
Qt::Core Qt::Core

Loading…
Cancel
Save