1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: replace the rest of .build with .build_module

This commit is contained in:
Alexander Medvednikov 2019-09-10 18:19:29 +03:00
parent edd8528049
commit 03b3278369
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ fn (v mut V) cc() {
a << libs a << libs
// Without these libs compilation will fail on Linux // Without these libs compilation will fail on Linux
// || os.user_os() == '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) { v.os == .netbsd || v.os == .dragonfly) {
a << '-lm -lpthread ' a << '-lm -lpthread '
// -ldl is a Linux only thing. BSDs have it in libc. // -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.') println('Cross compilation for Windows failed. Make sure you have clang installed.')
exit(1) 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 ' + link_cmd := 'lld-link $obj_name $winroot/lib/libcmt.lib ' +
'$winroot/lib/libucrt.lib $winroot/lib/kernel32.lib $winroot/lib/libvcruntime.lib ' + '$winroot/lib/libucrt.lib $winroot/lib/kernel32.lib $winroot/lib/libvcruntime.lib ' +
'$winroot/lib/uuid.lib' '$winroot/lib/uuid.lib'

View File

@ -367,7 +367,7 @@ string _STR_TMP(const char *fmt, ...) {
// Make sure the main function exists // Make sure the main function exists
// Obviously we don't need it in libraries // 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 { if !v.table.main_exists() && !v.pref.is_test {
// It can be skipped in single file programs // It can be skipped in single file programs
if v.pref.is_script { if v.pref.is_script {
@ -666,7 +666,7 @@ fn new_v(args[]string) &V {
mut mod := '' mut mod := ''
//if args.contains('-lib') { //if args.contains('-lib') {
if joined_args.contains('build module ') { if joined_args.contains('build module ') {
build_mode = .build build_mode = .build_module
// v -lib ~/v/os => os.o // v -lib ~/v/os => os.o
//mod = os.dir(dir) //mod = os.dir(dir)
mod = if dir.contains('/') { mod = if dir.contains('/') {