From 9cb5dbac8fc6b7f2b56f20734a7b71e12b39c6f4 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 31 Jan 2024 15:23:58 +0100 Subject: fix -fkeep-system-includes detection --- xmake/rules/c++/modules/modules_support/clang/compiler_support.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua index a39029c5a..8264daca8 100644 --- a/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua +++ b/xmake/rules/c++/modules/modules_support/clang/compiler_support.lua @@ -378,7 +378,7 @@ function get_keepsystemincludesflag(target) if keepsystemincludesflag == nil then local compinst = target:compiler("cxx") local clang_version = get_clang_version(target) - if compinst:has_flags("-fkeep-system-includes", "cxxflags", {flagskey = "clang_keep_system_includes", tryrun = true}) and + if compinst:has_flags("-E -fkeep-system-includes", "cxxflags", {flagskey = "clang_keep_system_includes", tryrun = true}) and semver.compare(clang_version, "18.0") >= 0 then keepsystemincludesflag = "-fkeep-system-includes" end -- cgit v1.3.1