diff options
| author | ruki <[email protected]> | 2023-11-14 22:07:35 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-14 22:07:35 +0800 |
| commit | 58c7481aab7ebfa66521cc292abe53a8b4cd7550 (patch) | |
| tree | 019c09833f45ed95d73f7183f9fdee3a22550e09 | |
| parent | e6504c8d0a4d42d2a57b68f9d25a0cbbb2c8289e (diff) | |
| parent | cb202af580fed1f3bccc8f0a3b3c8c89a9f26443 (diff) | |
Merge pull request #4387 from heheda123123/patch-8
Update cmakelists.lua
| -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]) |
