diff options
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 6b62ebe8a..0c78ba4bf 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -679,16 +679,20 @@ function _add_target_exceptions(cmakelists, target) } local exceptions = target:get("exceptions") if exceptions then - cmakelists:print("if(MSVC)") - -- msvc or clang-cl - for _, exception in ipairs(exceptions) do - cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_msvc[exception]) - end - cmakelists:print("else()") - for _, exception in ipairs(exceptions) do - cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_gcc[exception]) + if exceptions == "none" then + cmakelists:print("string(REPLACE \"/EHsc\" \"\" CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS}\")") + else + cmakelists:print("if(MSVC)") + -- msvc or clang-cl + for _, exception in ipairs(exceptions) do + cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_msvc[exception]) + end + cmakelists:print("else()") + for _, exception in ipairs(exceptions) do + cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_gcc[exception]) + end + cmakelists:print("endif()") end - cmakelists:print("endif()") end end |
