summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-08-24 23:55:06 +0800
committerruki <[email protected]>2018-08-24 17:30:39 +0800
commitf0fe86cec304f73c78f97356968f91be033026fa (patch)
tree5a44aa9b8fa238951ddc991fa78b9a3403c1d622
parente7bae1207a1b97850eeaffe05b67df8a8f1526dc (diff)
fix dlang has_flags bug
-rw-r--r--tests/projects/dlang/static_library/test.lua11
-rw-r--r--xmake/modules/detect/tools/dmd/has_flags.lua3
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/projects/dlang/static_library/test.lua b/tests/projects/dlang/static_library/test.lua
new file mode 100644
index 000000000..ba71889a5
--- /dev/null
+++ b/tests/projects/dlang/static_library/test.lua
@@ -0,0 +1,11 @@
+-- imports
+import("...build")
+
+-- main entry
+function main()
+
+ -- build project
+ if os.host() == "macosx" then
+ build()
+ end
+end
diff --git a/xmake/modules/detect/tools/dmd/has_flags.lua b/xmake/modules/detect/tools/dmd/has_flags.lua
index 58e52193d..7e33b5ab0 100644
--- a/xmake/modules/detect/tools/dmd/has_flags.lua
+++ b/xmake/modules/detect/tools/dmd/has_flags.lua
@@ -91,12 +91,13 @@ function _check_try_running(flags, opt, islinker)
-- make an stub source file
local sourcefile = path.join(os.tmpdir(), "detect", "dmd_has_flags.d")
+ local objectfile = path.join(os.tmpdir(), "detect", "dmd_has_flags.o")
if not os.isfile(sourcefile) then
io.writefile(sourcefile, "void main() {\n}")
end
-- init argv
- local argv = table.join(flags, "-of" .. os.nuldev(), sourcefile)
+ local argv = table.join(flags, "-of" .. objectfile, sourcefile)
if not islinker then
table.insert(argv, 1, "-c")
end