mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow linking libraries directly by file path.
This commit is contained in:
committed by
Christoffer Lerno
parent
4548c474bc
commit
ab2e18e255
@@ -431,6 +431,7 @@ static void linker_setup_freebsd(const char ***args_ref, Linker linker_type)
|
||||
static void add_linked_libs(const char ***args_ref, const char **libs, bool is_win)
|
||||
{
|
||||
FOREACH_BEGIN(const char *lib, libs)
|
||||
INFO_LOG("Linking %s", lib);
|
||||
const char *framework = str_remove_suffix(lib, ".framework");
|
||||
if (framework)
|
||||
{
|
||||
@@ -451,7 +452,15 @@ static void add_linked_libs(const char ***args_ref, const char **libs, bool is_w
|
||||
}
|
||||
else
|
||||
{
|
||||
add_arg2("-l", lib);
|
||||
if (str_has_suffix(lib, ".a") || str_has_suffix(lib, ".so") ||
|
||||
str_has_suffix(lib, ".dylib") || str_has_suffix(lib, ".tbd"))
|
||||
{
|
||||
add_arg(lib);
|
||||
}
|
||||
else
|
||||
{
|
||||
add_arg2("-l", lib);
|
||||
}
|
||||
}
|
||||
FOREACH_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user