diff options
| author | RimuruChan <[email protected]> | 2023-07-22 15:53:09 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-22 15:53:09 +0800 |
| commit | edc54d1e8b046780e032934a5462783298ec93ea (patch) | |
| tree | f72e98e00b8c3e0acf9cb56f7368d54bc03a6662 /xmake/plugins | |
| parent | cb6ac8efc7aecc0bf24d8a1844d0c76233cb84ea (diff) | |
fix: none exception for cmake
Diffstat (limited to 'xmake/plugins')
| -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 |
