diff options
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index fd0f6ff2c..fea241066 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -621,6 +621,13 @@ end function _add_target_exceptions(cmakelists, target) local flags_gcc = { + cxx = "-fexceptions", + ["no-cxx"] = "-fno-exceptions", + objc = "-fobjc-exceptions", + ["no-objc"] = "-fno-objc-exceptions" + } + local flags_clang = + { cxx = "-fcxx-exceptions", ["no-cxx"] = "-fno-cxx-exceptions", objc = "-fobjc-exceptions", @@ -641,6 +648,10 @@ function _add_target_exceptions(cmakelists, target) for _, exception in ipairs(exceptions) do cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_msvc[exception]) end + cmakelists:print("elseif(Clang)") + for _, exception in ipairs(exceptions) do + cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_clang[exception]) + end cmakelists:print("else()") for _, exception in ipairs(exceptions) do cmakelists:print(" target_compile_options(%s PRIVATE %s)", target:name(), flags_gcc[exception]) |
