summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
Diffstat (limited to 'xmake')
-rwxr-xr-xxmake/actions/build/main.lua2
-rw-r--r--xmake/languages/objc++/api.lua2
-rwxr-xr-xxmake/languages/objc++/xmake.lua10
-rw-r--r--xmake/languages/swift/api.lua2
-rwxr-xr-xxmake/languages/swift/xmake.lua9
-rw-r--r--xmake/templates/objc++/console/project/xmake.lua7
-rw-r--r--xmake/templates/objc/console/project/xmake.lua7
-rwxr-xr-xxmake/tools/gcc.lua7
-rw-r--r--xmake/tools/swiftc.lua7
9 files changed, 42 insertions, 11 deletions
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua
index 3f8dc460d..14e73b8f7 100755
--- a/xmake/actions/build/main.lua
+++ b/xmake/actions/build/main.lua
@@ -47,10 +47,8 @@ function main()
-- rebuild?
if option.get("rebuild") or cache.get("rebuild") then
- table.dump(os.match("$(buildir)/**", 'a'))
-- clean it first
task.run("clean", {target = targetname})
- table.dump(os.match("$(buildir)/**", 'a'))
-- reset state
cache.set("rebuild", nil)
diff --git a/xmake/languages/objc++/api.lua b/xmake/languages/objc++/api.lua
index 789f14605..82040a313 100644
--- a/xmake/languages/objc++/api.lua
+++ b/xmake/languages/objc++/api.lua
@@ -42,6 +42,7 @@ function apis()
, "target.add_undefines"
, "target.add_defines_h"
, "target.add_undefines_h"
+ , "target.add_frameworks"
-- option.add_xxx
, "option.add_cincludes"
, "option.add_cxxincludes"
@@ -62,6 +63,7 @@ function apis()
, "option.add_undefines"
, "option.add_undefines_if_ok"
, "option.add_undefines_h_if_ok"
+ , "option.add_frameworks"
}
_g.pathes =
{
diff --git a/xmake/languages/objc++/xmake.lua b/xmake/languages/objc++/xmake.lua
index 1557630ad..0919a8d7c 100755
--- a/xmake/languages/objc++/xmake.lua
+++ b/xmake/languages/objc++/xmake.lua
@@ -49,6 +49,7 @@ language("objc++")
compiler =
{
"config.includedirs"
+ , "config.frameworks"
, "target.symbols"
, "target.warnings"
, "target.optimize:check"
@@ -57,6 +58,7 @@ language("objc++")
, "target.includedirs"
, "target.defines"
, "target.undefines"
+ , "target.frameworks"
, "option.symbols"
, "option.warnings"
, "option.optimize:check"
@@ -67,9 +69,11 @@ language("objc++")
, "option.undefines"
, "option.defines_if_ok"
, "option.undefines_if_ok"
+ , "option.frameworks"
, "platform.includedirs"
, "platform.defines"
, "platform.undefines"
+ , "platform.frameworks"
}
, linker =
{
@@ -82,9 +86,13 @@ language("objc++")
, "option.linkdirs"
, "platform.linkdirs"
, "config.links"
+ , "config.frameworks"
, "target.links"
+ , "target.frameworks"
, "option.links"
+ , "option.frameworks"
, "platform.links"
+ , "platform.frameworks"
}
, archiver =
{
@@ -116,7 +124,7 @@ language("objc++")
, {nil, "links", "kv", nil, "The Link Libraries" }
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
-
+ , {nil, "frameworks", "kv", nil, "The Link Frameworks" }
}
}
diff --git a/xmake/languages/swift/api.lua b/xmake/languages/swift/api.lua
index 88d371630..63e1ddbfd 100644
--- a/xmake/languages/swift/api.lua
+++ b/xmake/languages/swift/api.lua
@@ -34,12 +34,14 @@ function apis()
, "target.add_ldflags"
, "target.add_arflags"
, "target.add_shflags"
+ , "target.add_frameworks"
-- option.add_xxx
, "option.add_links"
, "option.add_scflags"
, "option.add_ldflags"
, "option.add_arflags"
, "option.add_shflags"
+ , "option.add_frameworks"
}
_g.pathes =
{
diff --git a/xmake/languages/swift/xmake.lua b/xmake/languages/swift/xmake.lua
index 1a4409bd2..261039895 100755
--- a/xmake/languages/swift/xmake.lua
+++ b/xmake/languages/swift/xmake.lua
@@ -46,6 +46,7 @@ language("swift")
compiler =
{
"config.includedirs"
+ , "config.Frameworks"
, "target.symbols"
, "target.warnings"
, "target.optimize:check"
@@ -54,6 +55,7 @@ language("swift")
, "target.includedirs"
, "target.defines"
, "target.undefines"
+ , "target.frameworks"
, "option.symbols"
, "option.warnings"
, "option.optimize:check"
@@ -64,9 +66,11 @@ language("swift")
, "option.undefines"
, "option.defines_if_ok"
, "option.undefines_if_ok"
+ , "option.frameworks"
, "platform.includedirs"
, "platform.defines"
, "platform.undefines"
+ , "platform.frameworks"
}
, linker =
{
@@ -79,9 +83,13 @@ language("swift")
, "option.linkdirs"
, "platform.linkdirs"
, "config.links"
+ , "config.frameworks"
, "target.links"
+ , "target.frameworks"
, "option.links"
+ , "option.frameworks"
, "platform.links"
+ , "platform.frameworks"
}
, archiver =
{
@@ -114,6 +122,7 @@ language("swift")
, {nil, "links", "kv", nil, "The Link Libraries" }
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
+ , {nil, "frameworks", "kv", nil, "The Link Frameworks" }
}
}
diff --git a/xmake/templates/objc++/console/project/xmake.lua b/xmake/templates/objc++/console/project/xmake.lua
index d9d4a4ed0..7a56c9d69 100644
--- a/xmake/templates/objc++/console/project/xmake.lua
+++ b/xmake/templates/objc++/console/project/xmake.lua
@@ -21,13 +21,12 @@ if is_mode("release") then
set_strip("all")
end
+-- add frameworks
+add_frameworks("Foundation", "CoreFoundation")
+
-- for macosx or ios
if os("macosx", "ios") then
- -- add framework
- add_mxflags("-framework Foundation", "-framework CoreFoundation")
- add_ldflags("-framework Foundation", "-framework CoreFoundation")
-
-- enable arc?
add_mxflags("-fobjc-arc")
end
diff --git a/xmake/templates/objc/console/project/xmake.lua b/xmake/templates/objc/console/project/xmake.lua
index d2f3d710b..e7724adb5 100644
--- a/xmake/templates/objc/console/project/xmake.lua
+++ b/xmake/templates/objc/console/project/xmake.lua
@@ -21,13 +21,12 @@ if is_mode("release") then
set_strip("all")
end
+-- add frameworks
+add_frameworks("Foundation", "CoreFoundation")
+
-- for macosx or ios
if os("macosx", "ios") then
- -- add framework
- add_mxflags("-framework Foundation", "-framework CoreFoundation")
- add_ldflags("-framework Foundation", "-framework CoreFoundation")
-
-- enable arc?
add_mxflags("-fobjc-arc")
end
diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua
index 47832580f..6ad26c04e 100755
--- a/xmake/tools/gcc.lua
+++ b/xmake/tools/gcc.lua
@@ -231,6 +231,13 @@ function nf_linkdir(dir)
return "-L" .. dir
end
+-- make the framework flag
+function nf_framework(framework)
+
+ -- make it
+ return "-framework " .. framework
+end
+
-- make the link command
function linkcmd(objectfiles, targetfile, flags)
diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua
index 4fdca0f18..5b4823416 100644
--- a/xmake/tools/swiftc.lua
+++ b/xmake/tools/swiftc.lua
@@ -170,6 +170,13 @@ function nf_undefine(macro)
return "-Xcc -U" .. macro
end
+-- make the framework flag
+function nf_framework(framework)
+
+ -- make it
+ return "-framework" .. framework
+end
+
-- make the compile command
function compcmd(sourcefile, objectfile, flags)