From 7acac1b09d7e01de075d7471f2e6240a281cd762 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 25 Aug 2017 08:57:40 +0800 Subject: fix pcxxheader bug for gcc --- CHANGELOG.md | 8 ++++++++ xmake/modules/core/tools/gcc.lua | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5912aa45c..c42fa9f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ * Support `@loader_path` and `$ORIGIN` for `add_rpathdirs()` * Improve `set_version("x.x.x", {build = "%Y%m%d%H%M"})` and add build version +### Bugs fixed + +* Fix `set_pcxxheader` bug + ## v2.1.6 ### Changes @@ -350,6 +354,10 @@ * 对`add_rpathdirs()`增加对`@loader_path`和`$ORIGIN`的内置变量支持,提供可迁移动态库加载 * 改进`set_version("x.x.x", {build = "%Y%m%d%H%M"})` 支持buildversion设置 +### Bugs修复 + +* 修复`set_pcxxheader`编译没有继承flags配置问题 + ## v2.1.6 ### 改进 diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 821cc77ce..39e1d3864 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -344,8 +344,10 @@ function _compargv1_pch(self, pcheaderfile, pcoutputfile, flags) local pchflags = {} local include = false for _, flag in ipairs(flags) do - if not include and not flag:find("-include", 1, true) then - table.insert(pchflags, flag) + if not flag:find("-include", 1, true) then + if not include then + table.insert(pchflags, flag) + end include = false else include = true -- cgit v1.3.1