summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-25 08:57:40 +0800
committerruki <[email protected]>2017-08-25 08:57:40 +0800
commit7acac1b09d7e01de075d7471f2e6240a281cd762 (patch)
treeb6db26acf247a8a599039b31bd3862161faa0407
parent75f4436e96f5ecd5c8e50d1e2613b58e1b674ee2 (diff)
fix pcxxheader bug for gcc
-rw-r--r--CHANGELOG.md8
-rw-r--r--xmake/modules/core/tools/gcc.lua6
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