Skip to content

Commit

Permalink
fix dlang has_flags bug
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Aug 24, 2018
1 parent e7bae12 commit f0fe86c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions tests/projects/dlang/static_library/test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- imports
import("...build")

-- main entry
function main()

-- build project
if os.host() == "macosx" then
build()
end
end
3 changes: 2 additions & 1 deletion xmake/modules/detect/tools/dmd/has_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0fe86c

Please sign in to comment.