summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-08 00:35:44 +0800
committerruki <[email protected]>2022-02-08 00:35:44 +0800
commit45cc977dfc486fd4ac1506f351ab0ccc37a72e7b (patch)
tree063a900ee70d4d3ea4f754c3cacc84736d82fcfa
parent17d633d99e0adc0871b72c6b970349c5d077e3fd (diff)
fix tests
-rw-r--r--tests/projects/c/linker_scripts/src/foo.def2
-rw-r--r--tests/projects/c/linker_scripts/xmake.lua6
-rw-r--r--xmake/rules/asm/xmake.lua2
-rw-r--r--xmake/rules/c++/xmake.lua2
-rw-r--r--xmake/rules/dlang/xmake.lua2
-rw-r--r--xmake/rules/linker/xmake.lua24
6 files changed, 34 insertions, 4 deletions
diff --git a/tests/projects/c/linker_scripts/src/foo.def b/tests/projects/c/linker_scripts/src/foo.def
new file mode 100644
index 000000000..7e3ffcda0
--- /dev/null
+++ b/tests/projects/c/linker_scripts/src/foo.def
@@ -0,0 +1,2 @@
+EXPORTS
+foo
diff --git a/tests/projects/c/linker_scripts/xmake.lua b/tests/projects/c/linker_scripts/xmake.lua
index 2396d1b52..51f17f68b 100644
--- a/tests/projects/c/linker_scripts/xmake.lua
+++ b/tests/projects/c/linker_scripts/xmake.lua
@@ -9,5 +9,9 @@ target("test")
target("foo")
set_kind("shared")
add_files("src/foo.c")
- add_files("src/foo.map")
+ if is_plat("windows") then
+ add_files("src/foo.def")
+ else
+ add_files("src/foo.map")
+ end
diff --git a/xmake/rules/asm/xmake.lua b/xmake/rules/asm/xmake.lua
index d916af720..78b693137 100644
--- a/xmake/rules/asm/xmake.lua
+++ b/xmake/rules/asm/xmake.lua
@@ -43,5 +43,5 @@ rule("asm")
add_deps("platform.windows")
-- add linker rules
- add_deps("linker.link_scripts", "linker.version_scripts")
+ add_deps("linker")
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua
index 77223d0df..91ac9549c 100644
--- a/xmake/rules/c++/xmake.lua
+++ b/xmake/rules/c++/xmake.lua
@@ -66,5 +66,5 @@ rule("c++")
add_deps("platform.windows")
-- add linker rules
- add_deps("linker.link_scripts", "linker.version_scripts")
+ add_deps("linker")
diff --git a/xmake/rules/dlang/xmake.lua b/xmake/rules/dlang/xmake.lua
index 748026e85..3e123e0d8 100644
--- a/xmake/rules/dlang/xmake.lua
+++ b/xmake/rules/dlang/xmake.lua
@@ -40,5 +40,5 @@ rule("dlang")
add_deps("utils.symbols.extract")
-- add linker rules
- add_deps("linker.version_scripts")
+ add_deps("linker")
diff --git a/xmake/rules/linker/xmake.lua b/xmake/rules/linker/xmake.lua
new file mode 100644
index 000000000..602eecdfe
--- /dev/null
+++ b/xmake/rules/linker/xmake.lua
@@ -0,0 +1,24 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file xmake.lua
+--
+
+rule("linker")
+ add_deps("linker.link_scripts")
+ add_deps("linker.version_scripts")
+