From 03b32783691ced3d61d35fe08e0ea7853be18671 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 10 Sep 2019 18:19:29 +0300 Subject: [PATCH] compiler: replace the rest of .build with .build_module --- compiler/cc.v | 4 ++-- compiler/main.v | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/cc.v b/compiler/cc.v index 8a3f9653db..913b0da19d 100644 --- a/compiler/cc.v +++ b/compiler/cc.v @@ -132,7 +132,7 @@ fn (v mut V) cc() { a << libs // Without these libs compilation will fail on Linux // || os.user_os() == 'linux' - if v.pref.build_mode != .build && (v.os == .linux || v.os == .freebsd || v.os == .openbsd || + if v.pref.build_mode != .build_module && (v.os == .linux || v.os == .freebsd || v.os == .openbsd || v.os == .netbsd || v.os == .dragonfly) { a << '-lm -lpthread ' // -ldl is a Linux only thing. BSDs have it in libc. @@ -267,7 +267,7 @@ fn (c mut V) cc_windows_cross() { println('Cross compilation for Windows failed. Make sure you have clang installed.') exit(1) } - if c.pref.build_mode != .build { + if c.pref.build_mode != .build_module { link_cmd := 'lld-link $obj_name $winroot/lib/libcmt.lib ' + '$winroot/lib/libucrt.lib $winroot/lib/kernel32.lib $winroot/lib/libvcruntime.lib ' + '$winroot/lib/uuid.lib' diff --git a/compiler/main.v b/compiler/main.v index e1b482c9aa..f06b5673ee 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -367,7 +367,7 @@ string _STR_TMP(const char *fmt, ...) { // Make sure the main function exists // Obviously we don't need it in libraries - if v.pref.build_mode != .build { + if v.pref.build_mode != .build_module { if !v.table.main_exists() && !v.pref.is_test { // It can be skipped in single file programs if v.pref.is_script { @@ -666,7 +666,7 @@ fn new_v(args[]string) &V { mut mod := '' //if args.contains('-lib') { if joined_args.contains('build module ') { - build_mode = .build + build_mode = .build_module // v -lib ~/v/os => os.o //mod = os.dir(dir) mod = if dir.contains('/') {