From cb6fadf9173dc6bac9a7e6bc85eaadd162149aa6 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Sun, 8 Sep 2019 19:02:03 +1000 Subject: [PATCH] remove freetype submodule accidentally added in #1890 --- compiler/cc.v | 18 ++++++++++-------- compiler/cflags.v | 2 +- compiler/msvc.v | 24 ++++++++++++------------ thirdparty/freetype | 1 - 4 files changed, 23 insertions(+), 22 deletions(-) delete mode 160000 thirdparty/freetype diff --git a/compiler/cc.v b/compiler/cc.v index 98398c2d91..185f7e2eac 100644 --- a/compiler/cc.v +++ b/compiler/cc.v @@ -118,13 +118,14 @@ fn (v mut V) cc() { if v.os == .mac { a << '-mmacosx-version-min=10.7' } + cflags := v.get_os_cflags() // add all flags (-I -l -L etc) not .o files - for flag in v.get_os_cflags() { + for flag in cflags { if flag.value.ends_with('.o') { continue } a << flag.format() } // add .o files - for flag in v.get_os_cflags() { + for flag in cflags { if !flag.value.ends_with('.o') { continue } a << flag.format() } @@ -216,8 +217,9 @@ fn (c mut V) cc_windows_cross() { c.out_name = c.out_name + '.exe' } mut args := '-o $c.out_name -w -L. ' + cflags := c.get_os_cflags() // -I flags - for flag in c.get_os_cflags() { + for flag in cflags { if flag.name != '-l' { args += flag.format() args += ' ' @@ -236,11 +238,11 @@ fn (c mut V) cc_windows_cross() { } args += ' $c.out_name_c ' // -l flags (libs) - for flag in c.get_os_cflags() { - if flag.name == '-l' { - args += flag.format() - args += ' ' - } + for flag in cflags { + if flag.name == '-l' { + args += flag.format() + args += ' ' + } } println('Cross compiling for Windows...') winroot := '$ModPath/winroot' diff --git a/compiler/cflags.v b/compiler/cflags.v index fd7490a98f..b56bddfa12 100644 --- a/compiler/cflags.v +++ b/compiler/cflags.v @@ -53,7 +53,7 @@ fn (table mut Table) parse_cflag(cflag string) { allowed_flags := [ 'framework', 'library', - 'I', 'l', 'L', + 'I', 'l', 'L', ] mut flag := cflag.trim_space() if flag == '' { diff --git a/compiler/msvc.v b/compiler/msvc.v index 1fdb0dd1c8..0d82d73631 100644 --- a/compiler/msvc.v +++ b/compiler/msvc.v @@ -301,23 +301,22 @@ pub fn (v mut V) cc_msvc() { mut other_flags := []string{} for flag in v.get_os_cflags() { - mut arg := flag.value - //println('fl: $flag.name | flag arg: $arg') + //println('fl: $flag.name | flag arg: $flag.value') // We need to see if the flag contains -l // -l isnt recognised and these libs will be passed straight to the linker // by the compiler if flag.name == '-l' { - if arg.ends_with('.dll') { - cerror('MSVC cannot link against a dll (`#flag -l $arg`)') + if flag.value.ends_with('.dll') { + cerror('MSVC cannot link against a dll (`#flag -l $flag.value`)') } // MSVC has no method of linking against a .dll // TODO: we should look for .defs aswell - lib_lib := arg + '.lib' + lib_lib := flag.value + '.lib' real_libs << lib_lib } else if flag.name == '-I' { - inc_paths << ' ' + flag.format() + ' ' + inc_paths << flag.format() } else if flag.name == '-L' { lib_paths << flag.value @@ -329,18 +328,19 @@ pub fn (v mut V) cc_msvc() { // as for example for glfw3, compilation with gcc would fail. } else if flag.value.ends_with('.o') { - other_flags << flag.format().replace('.o', '.obj') + // msvc expects .obj not .o + other_flags << '"${flag.value}bj"' } else { - other_flags << arg + other_flags << flag.value } } // Include the base paths - a << ' -I "$r.ucrt_include_path" ' - a << ' -I "$r.vs_include_path" ' - a << ' -I "$r.um_include_path" ' - a << ' -I "$r.shared_include_path" ' + a << '-I "$r.ucrt_include_path"' + a << '-I "$r.vs_include_path"' + a << '-I "$r.um_include_path"' + a << '-I "$r.shared_include_path"' a << inc_paths diff --git a/thirdparty/freetype b/thirdparty/freetype deleted file mode 160000 index e4504fd25d..0000000000 --- a/thirdparty/freetype +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e4504fd25d7d23797ccfef336a33491c0d654129