From 3036bbdcccd78d82637e716cef06dda2a19b8991 Mon Sep 17 00:00:00 2001 From: Tom Hensel Date: Sat, 4 Jul 2026 13:17:44 +0200 Subject: [PATCH] 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. --- modemmeshcore/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modemmeshcore/CMakeLists.txt b/modemmeshcore/CMakeLists.txt index 3864e9d10..52c4219ba 100644 --- a/modemmeshcore/CMakeLists.txt +++ b/modemmeshcore/CMakeLists.txt @@ -33,9 +33,11 @@ add_library(modemmeshcore # Vendored Monocypher (BSD-2-Clause OR CC0-1.0) is intentionally untouched; # silence sdrangel's strict-warning policy for the two .c files. -set_source_files_properties(monocypher.c monocypher-ed25519.c - PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-unused-parameter" -) +if (NOT MSVC) + set_source_files_properties(monocypher.c monocypher-ed25519.c + PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-unused-parameter" + ) +endif() target_link_libraries(modemmeshcore Qt::Core