diff options
| author | ruki <[email protected]> | 2017-04-01 19:25:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-04-01 19:25:41 +0800 |
| commit | 192de2d5897e8bee0eefecabac637443125ce2a5 (patch) | |
| tree | d8b21f858a96476e7c814b11e6af0c89606866f2 | |
| parent | e215d77087a81a619a241e24077b5066929a2aa2 (diff) | |
add rpathdirs api
| -rwxr-xr-x | tests/shared_library_c/xmake.lua | 1 | ||||
| -rwxr-xr-x | tests/shared_library_dlang/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/languages/asm/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/asm/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/languages/c++/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/c++/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/languages/dlang/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/dlang/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/languages/objc++/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/objc++/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/languages/rust/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/rust/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/languages/swift/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/swift/xmake.lua | 3 | ||||
| -rw-r--r-- | xmake/tools/dmd.lua | 7 | ||||
| -rw-r--r-- | xmake/tools/gcc.lua | 7 | ||||
| -rw-r--r-- | xmake/tools/ldc.lua | 7 |
17 files changed, 53 insertions, 0 deletions
diff --git a/tests/shared_library_c/xmake.lua b/tests/shared_library_c/xmake.lua index c7526abdf..60c683b24 100755 --- a/tests/shared_library_c/xmake.lua +++ b/tests/shared_library_c/xmake.lua @@ -47,4 +47,5 @@ target("test") -- add link directory add_linkdirs("$(buildir)") + add_rpathdirs("$(buildir)") diff --git a/tests/shared_library_dlang/xmake.lua b/tests/shared_library_dlang/xmake.lua index 20c7fc521..c7fac23ca 100755 --- a/tests/shared_library_dlang/xmake.lua +++ b/tests/shared_library_dlang/xmake.lua @@ -47,6 +47,7 @@ target("test") -- add link directory add_linkdirs("$(buildir)") + add_rpathdirs("$(buildir)") -- add include directory add_includedirs("$(projectdir)/src") diff --git a/xmake/languages/asm/api.lua b/xmake/languages/asm/api.lua index 4a88611ba..23dd1eaf8 100644 --- a/xmake/languages/asm/api.lua +++ b/xmake/languages/asm/api.lua @@ -50,9 +50,11 @@ function apis() -- target.add_xxx "target.add_headers" , "target.add_linkdirs" + , "target.add_rpathdirs" , "target.add_includedirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" , "option.add_includedirs" } diff --git a/xmake/languages/asm/xmake.lua b/xmake/languages/asm/xmake.lua index 4fcf0e6c2..d1b93ee42 100644 --- a/xmake/languages/asm/xmake.lua +++ b/xmake/languages/asm/xmake.lua @@ -75,12 +75,15 @@ language("asm") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.strip" , "option.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" , "config.links" , "target.links" , "option.links" diff --git a/xmake/languages/c++/api.lua b/xmake/languages/c++/api.lua index c8f5fc7cc..65ce02967 100644 --- a/xmake/languages/c++/api.lua +++ b/xmake/languages/c++/api.lua @@ -185,9 +185,11 @@ function apis() -- target.add_xxx , "target.add_headers" , "target.add_linkdirs" + , "target.add_rpathdirs" , "target.add_includedirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" , "option.add_includedirs" } _g.custom = diff --git a/xmake/languages/c++/xmake.lua b/xmake/languages/c++/xmake.lua index a2c24e82a..cb40ac094 100644 --- a/xmake/languages/c++/xmake.lua +++ b/xmake/languages/c++/xmake.lua @@ -78,12 +78,15 @@ language("c++") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.strip" , "option.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" , "config.links" , "target.links" , "option.links" diff --git a/xmake/languages/dlang/api.lua b/xmake/languages/dlang/api.lua index 27d13640c..8a0a07a8d 100644 --- a/xmake/languages/dlang/api.lua +++ b/xmake/languages/dlang/api.lua @@ -45,9 +45,11 @@ function apis() { -- target.add_xxx "target.add_linkdirs" + , "target.add_rpathdirs" , "target.add_includedirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" , "option.add_includedirs" } diff --git a/xmake/languages/dlang/xmake.lua b/xmake/languages/dlang/xmake.lua index 493b5d81f..cb0ba9fe4 100644 --- a/xmake/languages/dlang/xmake.lua +++ b/xmake/languages/dlang/xmake.lua @@ -63,10 +63,13 @@ language("dlang") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" , "config.links" , "target.links" , "option.links" diff --git a/xmake/languages/objc++/api.lua b/xmake/languages/objc++/api.lua index 82040a313..ef1731cd1 100644 --- a/xmake/languages/objc++/api.lua +++ b/xmake/languages/objc++/api.lua @@ -73,9 +73,11 @@ function apis() -- target.add_xxx , "target.add_headers" , "target.add_linkdirs" + , "target.add_rpathdirs" , "target.add_includedirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" , "option.add_includedirs" } diff --git a/xmake/languages/objc++/xmake.lua b/xmake/languages/objc++/xmake.lua index 908ef206d..f1103fe63 100644 --- a/xmake/languages/objc++/xmake.lua +++ b/xmake/languages/objc++/xmake.lua @@ -82,12 +82,15 @@ language("objc++") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.strip" , "option.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" , "config.links" , "config.frameworks" , "target.links" diff --git a/xmake/languages/rust/api.lua b/xmake/languages/rust/api.lua index cc70db84c..aaa010634 100644 --- a/xmake/languages/rust/api.lua +++ b/xmake/languages/rust/api.lua @@ -45,9 +45,11 @@ function apis() { -- target.add_xxx "target.add_linkdirs" + , "target.add_rpathdirs" , "target.add_includedirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" , "option.add_includedirs" } diff --git a/xmake/languages/rust/xmake.lua b/xmake/languages/rust/xmake.lua index 87cd00d7d..0167dc5a8 100644 --- a/xmake/languages/rust/xmake.lua +++ b/xmake/languages/rust/xmake.lua @@ -60,10 +60,13 @@ language("rust") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" } , shared = { diff --git a/xmake/languages/swift/api.lua b/xmake/languages/swift/api.lua index 63e1ddbfd..102328e9b 100644 --- a/xmake/languages/swift/api.lua +++ b/xmake/languages/swift/api.lua @@ -47,8 +47,10 @@ function apis() { -- target.add_xxx "target.add_linkdirs" + , "target.add_rpathdirs" -- option.add_xxx , "option.add_linkdirs" + , "option.add_rpathdirs" } -- ok diff --git a/xmake/languages/swift/xmake.lua b/xmake/languages/swift/xmake.lua index 4686ddc2f..adbdf994b 100644 --- a/xmake/languages/swift/xmake.lua +++ b/xmake/languages/swift/xmake.lua @@ -79,12 +79,15 @@ language("swift") { "config.linkdirs" , "target.linkdirs" + , "target.rpathdirs" , "target.strip" , "target.symbols" , "option.strip" , "option.symbols" , "option.linkdirs" + , "option.rpathdirs" , "platform.linkdirs" + , "platform.rpathdirs" , "config.links" , "config.frameworks" , "target.links" diff --git a/xmake/tools/dmd.lua b/xmake/tools/dmd.lua index 10fb28342..6fb8e8b3b 100644 --- a/xmake/tools/dmd.lua +++ b/xmake/tools/dmd.lua @@ -159,6 +159,13 @@ function nf_linkdir(dir) return "-L-L" .. dir end +-- make the rpathdir flag +function nf_rpathdir(dir) + + -- make it + return "-L-rpath=" .. dir +end + -- make the link command function linkcmd(objectfiles, targetkind, targetfile, flags) diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua index d4dc2d930..a7b447df9 100644 --- a/xmake/tools/gcc.lua +++ b/xmake/tools/gcc.lua @@ -241,6 +241,13 @@ function nf_linkdir(dir) return "-L" .. dir end +-- make the rpathdir flag +function nf_rpathdir(dir) + + -- make it + return "-Wl,-rpath=" .. dir +end + -- make the framework flag function nf_framework(framework) diff --git a/xmake/tools/ldc.lua b/xmake/tools/ldc.lua index 0e995017c..531d319be 100644 --- a/xmake/tools/ldc.lua +++ b/xmake/tools/ldc.lua @@ -30,6 +30,13 @@ function init(shellname, kind) -- init super _super.init(shellname or "ldc", kind) + + -- init shflags + _super._g.shflags = { "-shared" } + + -- init cxflags for the kind: shared + _super._g.shared = {} end + |
