commit 2edd8225f05736a833c0c1827a7926bc04756027
Author: Kornel Benko <kor...@lyx.org>
Date:   Thu Jul 3 22:30:35 2025 +0200

    Cmake build: Discard unavailable compiler options
    
    These are options comming thru cmake-call like e.g.
    "-DLYX_CXX_FLAGS_EXTRA='-Werror;-Wundef;-pedantic'"
---
 CMakeLists.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 893bc0c3b0..7408304296 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -781,7 +781,10 @@ set(LYX_CXX_FLAGS_EXTRA "" CACHE STRING "Desired semicolon 
separated list of ext
 mark_as_advanced(LYX_CXX_FLAGS_EXTRA)
 if(LYX_CXX_FLAGS_EXTRA)
        foreach(_flag ${LYX_CXX_FLAGS_EXTRA})
-               add_definitions(${_flag})
+               CHECK_CXX_COMPILER_FLAG(${_flag} tmp_check_flag)
+               if (${tmp_check_flag})
+                       add_compile_options(${_flag})
+               endif()
        endforeach()
 endif()
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to