mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Changed string_has_extension to string_ends_with.
Fixed macOS target triple.
This commit is contained in:
+1
-1
@@ -1860,7 +1860,7 @@ void print_llvm_ir(irGen *ir) {
|
|||||||
i32 word_bits = cast(i32)(8*build_context.word_size);
|
i32 word_bits = cast(i32)(8*build_context.word_size);
|
||||||
if (build_context.ODIN_OS == "osx" || build_context.ODIN_OS == "macos") {
|
if (build_context.ODIN_OS == "osx" || build_context.ODIN_OS == "macos") {
|
||||||
GB_ASSERT(word_bits == 64);
|
GB_ASSERT(word_bits == 64);
|
||||||
ir_write_string(f, "target triple = x86_64-apple-macosx10.8\n\n");
|
ir_write_string(f, "target triple = \"x86_64-apple-macosx10.8\"\n\n");
|
||||||
} else if (build_context.ODIN_OS == "windows") {
|
} else if (build_context.ODIN_OS == "windows") {
|
||||||
// ir_fprintf(f, "target triple = \"x86%s-pc-windows\"\n\n", word_bits == 64 ? "_64" : "");
|
// ir_fprintf(f, "target triple = \"x86%s-pc-windows\"\n\n", word_bits == 64 ? "_64" : "");
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -859,10 +859,10 @@ int main(int arg_count, char **arg_ptr) {
|
|||||||
if (lib.len > 2 && lib[0] == '-' && lib[1] == 'f') {
|
if (lib.len > 2 && lib[0] == '-' && lib[1] == 'f') {
|
||||||
// framework thingie
|
// framework thingie
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", (int)(lib.len) - 2, lib.text + 2);
|
lib_str = gb_string_append_fmt(lib_str, " -framework %.*s ", (int)(lib.len) - 2, lib.text + 2);
|
||||||
} else if (string_has_extension(lib, str_lit("a"))) {
|
} else if (string_ends_with(lib, str_lit(".a"))) {
|
||||||
// static libs, absolute full path relative to the file in which the lib was imported from
|
// static libs, absolute full path relative to the file in which the lib was imported from
|
||||||
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " %.*s ", LIT(lib));
|
||||||
} else if (string_has_extension(lib, str_lit("dylib"))) {
|
} else if (string_ends_with(lib, str_lit(".dylib"))) {
|
||||||
// dynamic lib, relative path to executable
|
// dynamic lib, relative path to executable
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -l:%s/%.*s ", cwd, LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " -l:%s/%.*s ", cwd, LIT(lib));
|
||||||
} else {
|
} else {
|
||||||
@@ -875,10 +875,10 @@ int main(int arg_count, char **arg_ptr) {
|
|||||||
// available at runtime wherever the executable is run, so we make require those to be
|
// available at runtime wherever the executable is run, so we make require those to be
|
||||||
// local to the executable (unless the system collection is used, in which case we search
|
// local to the executable (unless the system collection is used, in which case we search
|
||||||
// the system library paths for the library file).
|
// the system library paths for the library file).
|
||||||
if (string_has_extension(lib, str_lit("a"))) {
|
if (string_ends_with(lib, str_lit(".a"))) {
|
||||||
// static libs, absolute full path relative to the file in which the lib was imported from
|
// static libs, absolute full path relative to the file in which the lib was imported from
|
||||||
lib_str = gb_string_append_fmt(lib_str, " -l:%.*s ", LIT(lib));
|
lib_str = gb_string_append_fmt(lib_str, " -l:%.*s ", LIT(lib));
|
||||||
} else if (string_has_extension(lib, str_lit("so"))) {
|
} else if (string_ends_with(lib, str_lit(".so"))) {
|
||||||
// dynamic lib, relative path to executable
|
// dynamic lib, relative path to executable
|
||||||
// NOTE(vassvik): it is the user's responsibility to make sure the shared library files are visible
|
// NOTE(vassvik): it is the user's responsibility to make sure the shared library files are visible
|
||||||
// at runtimeto the executable
|
// at runtimeto the executable
|
||||||
|
|||||||
+1
-1
@@ -4905,7 +4905,7 @@ bool determine_path_from_string(Parser *p, AstNode *node, String base_dir, Strin
|
|||||||
// working directory of the exe to the library search paths.
|
// working directory of the exe to the library search paths.
|
||||||
// Static libraries can be linked directly with the full pathname
|
// Static libraries can be linked directly with the full pathname
|
||||||
//
|
//
|
||||||
if (node->kind == AstNode_ForeignImportDecl && string_has_extension(file_str, str_lit("so"))) {
|
if (node->kind == AstNode_ForeignImportDecl && string_ends_with(file_str, str_lit(".so"))) {
|
||||||
*path = file_str;
|
*path = file_str;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user