aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorZachary Pierson <zacpiersonhehe@gmail.com>2017-11-10 16:11:55 -0600
committerZachary Pierson <zacpiersonhehe@gmail.com>2017-11-10 16:11:55 -0600
commit6d880bc3bb5b78ce6d38fae56c6b8ab3390095ed (patch)
tree1e9a74b3a364dd98ee94765ad9e582a9d7c4ffa8 /src/main.cpp
parent85fab55e57c033d94e79717e4491e11d95e9254e (diff)
Added static linking for macOS. Also fixed the build.sh. Thanks, vass :/
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index adb690dad..d3a705ab0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -833,7 +833,10 @@ int main(int arg_count, char **arg_ptr) {
if(lib.len > 2 && lib[0] == '-' && lib[1] == 'f') {
// framework thingie
len = gb_snprintf(lib_str_buf, gb_size_of(lib_str_buf), " -framework %.*s ", (int)(lib.len) - 2, lib.text + 2);
- } else if (string_has_extension(lib, str_lit("dylib"))) {
+ } else if (string_has_extension(lib, str_lit("a"))) {
+ // static libs, absolute full path relative to the file in which the lib was imported from
+ len = gb_snprintf(lib_str_buf, gb_size_of(lib_str_buf), " %.*s ", LIT(lib));
+ } else if (string_has_extension(lib, str_lit("dylib"))) {
// dynamic lib, relative path to executable
len = gb_snprintf(lib_str_buf, gb_size_of(lib_str_buf), " -l:%s/%.*s ", cwd, LIT(lib));
} else {
@@ -869,7 +872,6 @@ int main(int arg_count, char **arg_ptr) {
char *linker;
if (build_context.is_dll) {
// Shared libraries are .dylib on MacOS and .so on Linux.
- // TODO(zangent): Is that statement entirely truthful?
#if defined(GB_SYSTEM_OSX)
output_ext = ".dylib";
#else