summaryrefslogtreecommitdiff
path: root/xmake/platforms/linux/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-01-05 14:22:40 +0800
committerruki <[email protected]>2017-01-06 17:20:09 +0800
commit61465cbf8df493c13c0adf2adfc985b679933bdd (patch)
tree0a0bc75d249b59cfac6e095d5b323c46c62c988c /xmake/platforms/linux/xmake.lua
parenta79375f2e32977068e783ac4edf881bd6ccfaaaa (diff)
move load script for platform
Diffstat (limited to 'xmake/platforms/linux/xmake.lua')
-rwxr-xr-xxmake/platforms/linux/xmake.lua49
1 files changed, 1 insertions, 48 deletions
diff --git a/xmake/platforms/linux/xmake.lua b/xmake/platforms/linux/xmake.lua
index b546fbbd8..8e6dc4315 100755
--- a/xmake/platforms/linux/xmake.lua
+++ b/xmake/platforms/linux/xmake.lua
@@ -45,54 +45,7 @@ platform("linux")
on_check("check")
-- on load
- on_load(function ()
-
- -- imports
- import("core.project.config")
-
- -- init the file formats
- _g.formats = {}
- _g.formats.static = {"lib", ".a"}
- _g.formats.object = {"", ".o"}
- _g.formats.shared = {"lib", ".so"}
- _g.formats.symbol = {"", ".sym"}
-
- -- cross toolchains?
- if config.get("cross") or config.get("toolchains") or config.get("sdk") then
-
- -- init linkdirs and includedirs
- local sdkdir = config.get("sdk")
- if sdkdir then
- _g.includedirs = {path.join(sdkdir, "include")}
- _g.linkdirs = {path.join(sdkdir, "lib")}
- end
-
- -- ok
- return _g
- end
-
- -- init flags for architecture
- local archflags = nil
- local arch = config.get("arch")
- if arch then
- if arch == "x86_64" then archflags = "-m64"
- elseif arch == "i386" then archflags = "-m32"
- else archflags = "-arch " .. arch
- end
- end
- _g.cxflags = { archflags }
- _g.mxflags = { archflags }
- _g.asflags = { archflags }
- _g.ldflags = { archflags }
- _g.shflags = { archflags }
-
- -- init linkdirs and includedirs
- _g.linkdirs = {"/usr/lib", "/usr/local/lib"}
- _g.includedirs = {"/usr/include", "/usr/local/include"}
-
- -- ok
- return _g
- end)
+ on_load("load")