diff options
| -rw-r--r-- | tests/projects/dlang/static_library/test.lua | 11 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/dmd/has_flags.lua | 3 |
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 |
