mirror of
https://github.com/dlang/tools.git
synced 2025-04-29 22:50:40 +03:00
rdmd: Use .dylib instead of .so on macOS
This commit is contained in:
parent
b7d2ef2f41
commit
c950a65bd9
2 changed files with 7 additions and 4 deletions
|
@ -1,3 +1,3 @@
|
||||||
rdmd supports `-shared`
|
rdmd supports `-shared`
|
||||||
|
|
||||||
rdmd now understands DMD's `-shared` switch, and sets the default output file name appropriately (`.dll` or `so` depending on the platform), in the same way as `-lib`.
|
rdmd now understands DMD's `-shared` switch, and sets the default output file name appropriately (`.dll`, `.so`, or `.dylib` depending on the platform), in the same way as `-lib`.
|
||||||
|
|
7
rdmd.d
7
rdmd.d
|
@ -27,6 +27,9 @@ version (Posix)
|
||||||
enum objExt = ".o";
|
enum objExt = ".o";
|
||||||
enum binExt = "";
|
enum binExt = "";
|
||||||
enum libExt = ".a";
|
enum libExt = ".a";
|
||||||
|
version (OSX)
|
||||||
|
enum dllExt = ".dylib";
|
||||||
|
else
|
||||||
enum dllExt = ".so";
|
enum dllExt = ".so";
|
||||||
enum altDirSeparator = "";
|
enum altDirSeparator = "";
|
||||||
}
|
}
|
||||||
|
@ -367,7 +370,7 @@ size_t indexOfProgram(string[] args)
|
||||||
{
|
{
|
||||||
auto arg = args[i];
|
auto arg = args[i];
|
||||||
if (!arg.startsWith('-', '@') &&
|
if (!arg.startsWith('-', '@') &&
|
||||||
!arg.endsWith(".obj", ".o", ".lib", ".a", ".dll", ".so", ".def", ".map", ".res") &&
|
!arg.endsWith(".obj", ".o", ".lib", ".a", ".dll", ".so", ".dylib", ".def", ".map", ".res") &&
|
||||||
args[i - 1] != "--eval")
|
args[i - 1] != "--eval")
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
|
@ -634,7 +637,7 @@ private string[string] getDependencies(string rootModule, string workDir,
|
||||||
string[] names = [libName ~ ".lib"];
|
string[] names = [libName ~ ".lib"];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string[] names = ["lib" ~ libName ~ ".a", "lib" ~ libName ~ ".so"];
|
string[] names = ["lib" ~ libName ~ ".a", "lib" ~ libName ~ ".so", "lib" ~ libName ~ ".dylib"];
|
||||||
dirs ~= ["/lib", "/usr/lib"];
|
dirs ~= ["/lib", "/usr/lib"];
|
||||||
}
|
}
|
||||||
foreach (dir; dirs)
|
foreach (dir; dirs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue