builder: use .dylib for -shared builds in macOS
parent
104c278216
commit
b3f2c629c6
|
@ -44,6 +44,7 @@ fn gen_gitignore(name string) string {
|
|||
'main',
|
||||
'$name',
|
||||
'*.so',
|
||||
'*.dylib',
|
||||
'*.dll'
|
||||
].join('\n')
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ module dl
|
|||
pub const (
|
||||
rtld_now = C.RTLD_NOW
|
||||
rtld_lazy = C.RTLD_LAZY
|
||||
dl_ext = '.so'
|
||||
dl_ext = '.so'
|
||||
)
|
||||
|
||||
fn C.dlopen(filename charptr, flags int) voidptr
|
||||
|
|
|
@ -147,7 +147,11 @@ fn (mut v Builder) cc() {
|
|||
if v.pref.is_shared {
|
||||
linker_flags << '-shared'
|
||||
a << '-fPIC' // -Wl,-z,defs'
|
||||
v.pref.out_name += '.so'
|
||||
$if macos {
|
||||
v.pref.out_name += '.dylib'
|
||||
} $else {
|
||||
v.pref.out_name += '.so'
|
||||
}
|
||||
}
|
||||
if v.pref.is_bare {
|
||||
a << '-fno-stack-protector'
|
||||
|
|
Loading…
Reference in New Issue