summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-25 00:20:11 +0800
committerruki <[email protected]>2018-04-24 20:01:07 +0800
commit6979a6d5a135c109a448a2551ca038a9151c94ca (patch)
treec6f67fbab6f18589e9f0586ca1e6d2f0711ae972
parentc3d4cf3f4a994897cf95a9c0c8f9800dc32f2371 (diff)
support yasm
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/platforms/linux/load.lua2
-rw-r--r--xmake/platforms/macosx/load.lua2
-rw-r--r--xmake/platforms/windows/xmake.lua6
4 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e839d67d4..81d0b1489 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
* Add color256 codes
* [#160](https://github.com/tboox/xmake/issues/160): Add Qt compilation environment support and add `qt.console`, `qt.application` rules
* Add some Qt project templates
+* [#169](https://github.com/tboox/xmake/issues/169): support yasm for linux, macosx and windows
### Changes
@@ -459,6 +460,7 @@
* 添加color256代码
* [#160](https://github.com/tboox/xmake/issues/160): 增加对Qt SDK编译环境的跨平台支持,并且增加`qt.console`, `qt.application`等规则
* 添加一些Qt工程模板
+* [#169](https://github.com/tboox/xmake/issues/169): 支持yasm汇编器
### 改进
diff --git a/xmake/platforms/linux/load.lua b/xmake/platforms/linux/load.lua
index b36827a82..5710b09d8 100644
--- a/xmake/platforms/linux/load.lua
+++ b/xmake/platforms/linux/load.lua
@@ -62,7 +62,7 @@ function main()
-- init flags for asm
local as = config.get("as")
if as == "yasm" then
- _g.asflags = { "-f", "elf" }
+ _g.asflags = { "-f", arch == "x86_64" and "elf64" or "elf32" }
else
_g.asflags = { archflags }
end
diff --git a/xmake/platforms/macosx/load.lua b/xmake/platforms/macosx/load.lua
index 92d814798..9d3332a42 100644
--- a/xmake/platforms/macosx/load.lua
+++ b/xmake/platforms/macosx/load.lua
@@ -68,7 +68,7 @@ function main()
-- init flags for asm
local as = config.get("as")
if as == "yasm" then
- _g.asflags = { "-f", "macho64" }
+ _g.asflags = { "-f", arch == "x86_64" and "macho64" or "macho32" }
else
_g.asflags = { "-arch " .. arch }
if xcode_sdkdir then
diff --git a/xmake/platforms/windows/xmake.lua b/xmake/platforms/windows/xmake.lua
index 516209a70..a2b6fad0c 100644
--- a/xmake/platforms/windows/xmake.lua
+++ b/xmake/platforms/windows/xmake.lua
@@ -57,6 +57,12 @@ platform("windows")
_g.formats.binary = {"", ".exe"}
_g.formats.symbol = {"", ".pdb"}
+ -- init flags for asm
+ local as = config.get("as")
+ if as:find("yasm", 1, true) then
+ _g.asflags = { "-f", arch == "x64" and "win64" or "win32" }
+ end
+
-- init flags for dlang
local dc_archs = { x86 = "-m32", x64 = "-m64" }
_g.dcflags = { dc_archs[arch] }