aboutsummaryrefslogtreecommitdiff
path: root/src/linker.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-03-25 22:06:44 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2024-03-26 21:00:14 +0100
commit19d566ebc5c9b0f99620226537c7f0fba1960333 (patch)
tree9e79f05eb68439f3da498c6b9caa73e0edffa420 /src/linker.cpp
parent63d6b4752bcbc5ca28adbd13ef91fee25d4f7465 (diff)
darwin: fix linker warning when building dynamic library
Trying to fix all linker warnings that macOS comes up with, when building a dynamic library it currently emits `ld: warning: ignoring -e, not used for output type`
Diffstat (limited to 'src/linker.cpp')
-rw-r--r--src/linker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/linker.cpp b/src/linker.cpp
index 63987f9e8..0e3169b22 100644
--- a/src/linker.cpp
+++ b/src/linker.cpp
@@ -508,8 +508,10 @@ gb_internal i32 linker_stage(LinkerData *gen) {
link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string));
}
- // This points the linker to where the entry point is
- link_settings = gb_string_appendc(link_settings, "-e _main ");
+ if (build_context.build_mode != BuildMode_DynamicLibrary) {
+ // This points the linker to where the entry point is
+ link_settings = gb_string_appendc(link_settings, "-e _main ");
+ }
}
if (!build_context.no_crt) {