diff options
| author | ruki <[email protected]> | 2025-04-01 23:52:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-01 23:52:25 +0800 |
| commit | c9a4d00fa7a9ccf913463df5835d5c7c37b3aa41 (patch) | |
| tree | 00e2de84ffbe05aacaf340e16619886df6e47881 | |
| parent | f00ac09cae31ed9aa5c191a6ad5f620c2ddfceed (diff) | |
improve check_macros
| -rw-r--r-- | xmake/includes/check/check_macros.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/includes/check/check_macros.lua b/xmake/includes/check/check_macros.lua index ebefe482a..3e49a9331 100644 --- a/xmake/includes/check/check_macros.lua +++ b/xmake/includes/check/check_macros.lua @@ -71,7 +71,9 @@ function check_macros(definition, macros, opt) if opt.cxxflags then add_cxxflags(opt.cxxflags) end - if opt.includes then + if opt.languages and opt.languages:startswith("c++") then + add_cxxincludes(opt.includes) + else add_cincludes(opt.includes) end option_end() @@ -134,7 +136,11 @@ function configvar_check_macros(definition, macros, opt) add_cxxflags(opt.cxxflags) end if opt.includes then - add_cincludes(opt.includes) + if opt.languages and opt.languages:startswith("c++") then + add_cxxincludes(opt.includes) + else + add_cincludes(opt.includes) + end end option_end() interp_restore_scope() |
