summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-15 20:14:13 +0800
committerruki <[email protected]>2017-07-15 20:14:13 +0800
commit52fe9fc2ad2dbd0c25a873b7a297259d8af102a9 (patch)
tree716e07410c585b9c7eb3ed1201aea79a3982e49a
parentc3576499ce8251ce6bf8610eb7b2b67d3e34a61b (diff)
add_frameworkdirs api
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/languages/c++/api.lua2
-rw-r--r--xmake/languages/c++/xmake.lua52
-rw-r--r--xmake/languages/objc++/api.lua2
-rw-r--r--xmake/languages/objc++/xmake.lua53
-rw-r--r--xmake/languages/swift/api.lua2
-rw-r--r--xmake/languages/swift/xmake.lua31
-rw-r--r--xmake/modules/core/tools/gcc.lua5
-rw-r--r--xmake/modules/core/tools/swiftc.lua5
9 files changed, 106 insertions, 48 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afbb8ad2b..a2c7417f6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
* Add `has_flags`, `features` and `has_features` for detect module interfaces.
* Add `option.on_check`, `option.after_check` and `option.before_check` api
* Add `target.on_load` api
+* [#132](https://github.com/tboox/xmake/issues/132): Add `add_frameworkdirs` api
### Changes
@@ -319,6 +320,7 @@
* 增加`has_flags`, `features`和`has_features`等探测模块接口
* 添加`option.on_check`, `option.after_check` 和 `option.before_check` 接口
* 添加`target.on_load`接口
+* [#132](https://github.com/tboox/xmake/issues/132): 添加`add_frameworkdirs`接口
### 改进
diff --git a/xmake/languages/c++/api.lua b/xmake/languages/c++/api.lua
index d116fdeac..465e63c6d 100644
--- a/xmake/languages/c++/api.lua
+++ b/xmake/languages/c++/api.lua
@@ -212,10 +212,12 @@ function apis()
, "target.add_linkdirs"
, "target.add_rpathdirs"
, "target.add_includedirs"
+ , "target.add_frameworkdirs"
-- option.add_xxx
, "option.add_linkdirs"
, "option.add_rpathdirs"
, "option.add_includedirs"
+ , "option.add_frameworkdirs"
}
_g.dictionary =
{
diff --git a/xmake/languages/c++/xmake.lua b/xmake/languages/c++/xmake.lua
index 43be57228..a30b5e3c1 100644
--- a/xmake/languages/c++/xmake.lua
+++ b/xmake/languages/c++/xmake.lua
@@ -55,6 +55,7 @@ language("c++")
object =
{
"config.includedirs"
+ , "config.frameworkdirs"
, "config.frameworks"
, "target.symbols"
, "target.warnings"
@@ -64,6 +65,7 @@ language("c++")
, "target.includedirs"
, "target.defines"
, "target.undefines"
+ , "target.frameworkdirs"
, "target.frameworks"
, "option.symbols"
, "option.warnings"
@@ -75,16 +77,20 @@ language("c++")
, "option.undefines"
, "option.defines_if_ok"
, "option.undefines_if_ok"
+ , "option.frameworkdirs"
, "option.frameworks"
, "platform.includedirs"
, "platform.defines"
, "platform.undefines"
+ , "platform.frameworkdirs"
, "platform.frameworks"
}
, binary =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
+ , "target.frameworkdirs"
, "target.rpathdirs"
, "target.strip"
, "target.symbols"
@@ -92,8 +98,10 @@ language("c++")
, "option.symbols"
, "option.linkdirs"
, "option.rpathdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
, "platform.rpathdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -106,13 +114,17 @@ language("c++")
, shared =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
+ , "target.frameworkdirs"
, "target.strip"
, "target.symbols"
, "option.strip"
, "option.symbols"
, "option.linkdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -133,29 +145,31 @@ language("c++")
set_menu {
config =
{
- {}
- , {nil, "cc", "kv", nil, "The C Compiler" }
- , {nil, "cxx", "kv", nil, "The C++ Compiler" }
- , {nil, "cflags", "kv", nil, "The C Compiler Flags" }
- , {nil, "cxflags", "kv", nil, "The C/C++ compiler Flags" }
- , {nil, "cxxflags", "kv", nil, "The C++ Compiler Flags" }
+ { }
+ , {nil, "cc", "kv", nil, "The C Compiler" }
+ , {nil, "cxx", "kv", nil, "The C++ Compiler" }
+ , {nil, "cflags", "kv", nil, "The C Compiler Flags" }
+ , {nil, "cxflags", "kv", nil, "The C/C++ compiler Flags" }
+ , {nil, "cxxflags", "kv", nil, "The C++ Compiler Flags" }
- , {}
- , {nil, "ld", "kv", nil, "The Linker" }
- , {nil, "ldflags", "kv", nil, "The Binary Linker Flags" }
+ , { }
+ , {nil, "ld", "kv", nil, "The Linker" }
+ , {nil, "ldflags", "kv", nil, "The Binary Linker Flags" }
- , {}
- , {nil, "ar", "kv", nil, "The Static Library Linker" }
- , {nil, "arflags", "kv", nil, "The Static Library Linker Flags" }
+ , { }
+ , {nil, "ar", "kv", nil, "The Static Library Linker" }
+ , {nil, "arflags", "kv", nil, "The Static Library Linker Flags" }
- , {}
- , {nil, "sh", "kv", nil, "The Shared Library Linker" }
- , {nil, "shflags", "kv", nil, "The Shared Library Linker Flags" }
+ , { }
+ , {nil, "sh", "kv", nil, "The Shared Library Linker" }
+ , {nil, "shflags", "kv", nil, "The Shared Library Linker Flags" }
- , {}
- , {nil, "links", "kv", nil, "The Link Libraries" }
- , {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
- , {nil, "includedirs","kv", nil, "The Include Search Directories" }
+ , { }
+ , {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 Include and Link Frameworks" }
+ , {nil, "frameworkdirs", "kv", nil, "The Include and Link Frameworks Search Directories" }
}
}
diff --git a/xmake/languages/objc++/api.lua b/xmake/languages/objc++/api.lua
index ef1731cd1..4c6d8fc75 100644
--- a/xmake/languages/objc++/api.lua
+++ b/xmake/languages/objc++/api.lua
@@ -75,10 +75,12 @@ function apis()
, "target.add_linkdirs"
, "target.add_rpathdirs"
, "target.add_includedirs"
+ , "target.add_frameworkdirs"
-- option.add_xxx
, "option.add_linkdirs"
, "option.add_rpathdirs"
, "option.add_includedirs"
+ , "option.add_frameworkdirs"
}
-- ok
diff --git a/xmake/languages/objc++/xmake.lua b/xmake/languages/objc++/xmake.lua
index 8ba0dc135..0f5cb3b0a 100644
--- a/xmake/languages/objc++/xmake.lua
+++ b/xmake/languages/objc++/xmake.lua
@@ -55,6 +55,7 @@ language("objc++")
object =
{
"config.includedirs"
+ , "config.frameworkdirs"
, "config.frameworks"
, "target.symbols"
, "target.warnings"
@@ -64,6 +65,7 @@ language("objc++")
, "target.includedirs"
, "target.defines"
, "target.undefines"
+ , "target.frameworkdirs"
, "target.frameworks"
, "option.symbols"
, "option.warnings"
@@ -75,25 +77,31 @@ language("objc++")
, "option.undefines"
, "option.defines_if_ok"
, "option.undefines_if_ok"
+ , "option.frameworkdirs"
, "option.frameworks"
, "platform.includedirs"
, "platform.defines"
, "platform.undefines"
+ , "platform.frameworkdirs"
, "platform.frameworks"
}
, binary =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
, "target.rpathdirs"
+ , "target.frameworkdirs"
, "target.strip"
, "target.symbols"
, "option.strip"
, "option.symbols"
, "option.linkdirs"
, "option.rpathdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
, "platform.rpathdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -106,13 +114,17 @@ language("objc++")
, shared =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
+ , "target.frameworkdirs"
, "target.strip"
, "target.symbols"
, "option.strip"
, "option.symbols"
, "option.linkdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -133,30 +145,31 @@ language("objc++")
set_menu {
config =
{
- {}
- , {nil, "mm", "kv", nil, "The Objc Compiler" }
- , {nil, "mxx", "kv", nil, "The Objc++ Compiler" }
- , {nil, "mflags", "kv", nil, "The Objc Compiler Flags" }
- , {nil, "mxflags", "kv", nil, "The Objc/c++ Compiler Flags" }
- , {nil, "mxxflags", "kv", nil, "The Objc++ Compiler Flags" }
+ { }
+ , {nil, "mm", "kv", nil, "The Objc Compiler" }
+ , {nil, "mxx", "kv", nil, "The Objc++ Compiler" }
+ , {nil, "mflags", "kv", nil, "The Objc Compiler Flags" }
+ , {nil, "mxflags", "kv", nil, "The Objc/c++ Compiler Flags" }
+ , {nil, "mxxflags", "kv", nil, "The Objc++ Compiler Flags" }
- , {}
- , {nil, "ld", "kv", nil, "The Linker" }
- , {nil, "ldflags", "kv", nil, "The Binary Linker Flags" }
+ , { }
+ , {nil, "ld", "kv", nil, "The Linker" }
+ , {nil, "ldflags", "kv", nil, "The Binary Linker Flags" }
- , {}
- , {nil, "ar", "kv", nil, "The Static Library Linker" }
- , {nil, "arflags", "kv", nil, "The Static Library Linker Flags" }
+ , { }
+ , {nil, "ar", "kv", nil, "The Static Library Linker" }
+ , {nil, "arflags", "kv", nil, "The Static Library Linker Flags" }
- , {}
- , {nil, "sh", "kv", nil, "The Shared Library Linker" }
- , {nil, "shflags", "kv", nil, "The Shared Library Linker Flags" }
+ , { }
+ , {nil, "sh", "kv", nil, "The Shared Library Linker" }
+ , {nil, "shflags", "kv", nil, "The Shared Library Linker Flags" }
- , {}
- , {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" }
+ , { }
+ , {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 Include and Link Frameworks" }
+ , {nil, "frameworkdirs", "kv", nil, "The Include and Link Frameworks Search Directories" }
}
}
diff --git a/xmake/languages/swift/api.lua b/xmake/languages/swift/api.lua
index 102328e9b..e6b14d026 100644
--- a/xmake/languages/swift/api.lua
+++ b/xmake/languages/swift/api.lua
@@ -48,9 +48,11 @@ function apis()
-- target.add_xxx
"target.add_linkdirs"
, "target.add_rpathdirs"
+ , "target.add_frameworkdirs"
-- option.add_xxx
, "option.add_linkdirs"
, "option.add_rpathdirs"
+ , "option.add_frameworkdirs"
}
-- ok
diff --git a/xmake/languages/swift/xmake.lua b/xmake/languages/swift/xmake.lua
index 503928555..a764dc91d 100644
--- a/xmake/languages/swift/xmake.lua
+++ b/xmake/languages/swift/xmake.lua
@@ -52,6 +52,7 @@ language("swift")
object =
{
"config.includedirs"
+ , "config.frameworkdirs"
, "config.Frameworks"
, "target.symbols"
, "target.warnings"
@@ -61,6 +62,7 @@ language("swift")
, "target.includedirs"
, "target.defines"
, "target.undefines"
+ , "target.frameworkdirs"
, "target.frameworks"
, "option.symbols"
, "option.warnings"
@@ -72,25 +74,31 @@ language("swift")
, "option.undefines"
, "option.defines_if_ok"
, "option.undefines_if_ok"
+ , "option.frameworkdirs"
, "option.frameworks"
, "platform.includedirs"
, "platform.defines"
, "platform.undefines"
+ , "platform.frameworkdirs"
, "platform.frameworks"
}
, binary =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
, "target.rpathdirs"
+ , "target.frameworkdirs"
, "target.strip"
, "target.symbols"
, "option.strip"
, "option.symbols"
, "option.linkdirs"
, "option.rpathdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
, "platform.rpathdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -103,13 +111,17 @@ language("swift")
, shared =
{
"config.linkdirs"
+ , "config.frameworkdirs"
, "target.linkdirs"
+ , "target.frameworkdirs"
, "target.strip"
, "target.symbols"
, "option.strip"
, "option.symbols"
, "option.linkdirs"
+ , "option.frameworkdirs"
, "platform.linkdirs"
+ , "platform.frameworkdirs"
, "config.links"
, "config.frameworks"
, "target.links"
@@ -130,16 +142,17 @@ language("swift")
set_menu {
config =
{
- { }
- , { nil, "sc", "kv", nil, "The Swift Compiler" }
- , { nil, "sc-ld", "kv", nil, "The Swift Linker" }
- , { nil, "sc-sh", "kv", nil, "The Swift Shared Library Linker" }
+ { }
+ , {nil, "sc", "kv", nil, "The Swift Compiler" }
+ , {nil, "sc-ld", "kv", nil, "The Swift Linker" }
+ , {nil, "sc-sh", "kv", nil, "The Swift Shared Library Linker" }
- , { }
- , { 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" }
+ , { }
+ , {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 Include and Link Frameworks" }
+ , {nil, "frameworkdirs", "kv", nil, "The Include and Link Frameworks Search Directories" }
}
}
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 0c0d27ac5..7665f827e 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -243,6 +243,11 @@ function nf_framework(self, framework)
return "-framework " .. framework
end
+-- make the frameworkdir flag
+function nf_frameworkdir(self, frameworkdir)
+ return "-F " .. frameworkdir
+end
+
-- make the link arguments list
function linkargv(self, objectfiles, targetkind, targetfile, flags)
return self:program(), table.join("-o", targetfile, objectfiles, flags)
diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua
index 714d2b1b1..e233e1f9f 100644
--- a/xmake/modules/core/tools/swiftc.lua
+++ b/xmake/modules/core/tools/swiftc.lua
@@ -170,6 +170,11 @@ function nf_framework(self, framework)
return "-framework " .. framework
end
+-- make the frameworkdir flag
+function nf_frameworkdir(self, frameworkdir)
+ return "-F " .. frameworkdir
+end
+
-- make the link flag
function nf_link(self, lib)
return "-l" .. lib