From 0df6eaa927e169445ae21ce931ea4f7d7d32d15b Mon Sep 17 00:00:00 2001 From: vitalyster Date: Thu, 12 Mar 2020 20:20:19 +0300 Subject: [PATCH] "#flag mingw ..." support --- vlib/compiler/cflags.v | 4 ++-- vlib/glfw/glfw.v | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vlib/compiler/cflags.v b/vlib/compiler/cflags.v index 60fe77bb9d..26f1032509 100644 --- a/vlib/compiler/cflags.v +++ b/vlib/compiler/cflags.v @@ -25,7 +25,7 @@ fn (v &V) get_os_cflags() []CFlag { } for flag in v.table.cflags { - if flag.os == '' || (flag.os == 'linux' && v.pref.os == .linux) || (flag.os == 'darwin' && v.pref.os == .mac) || (flag.os == 'freebsd' && v.pref.os == .freebsd) || (flag.os == 'windows' && v.pref.os == .windows) { + if flag.os == '' || (flag.os == 'linux' && v.pref.os == .linux) || (flag.os == 'darwin' && v.pref.os == .mac) || (flag.os == 'freebsd' && v.pref.os == .freebsd) || (flag.os == 'windows' && v.pref.os == .windows) || (flag.os == 'mingw' && v.pref.os == .windows && v.pref.ccompiler != 'msvc') { flags << flag } if flag.os in ctimedefines { @@ -82,7 +82,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string, ctimedefines []string return true } mut fos := '' - mut allowed_os_overrides := ['linux','darwin','freebsd','windows'] + mut allowed_os_overrides := ['linux', 'darwin', 'freebsd', 'windows', 'mingw'] allowed_os_overrides << ctimedefines for os_override in allowed_os_overrides { if !flag.starts_with( os_override ) { continue } diff --git a/vlib/glfw/glfw.v b/vlib/glfw/glfw.v index a255046ae2..002a039d1c 100644 --- a/vlib/glfw/glfw.v +++ b/vlib/glfw/glfw.v @@ -22,6 +22,7 @@ import gl #flag freebsd -Wl,-L/usr/local/lib,-lglfw #flag linux -lglfw #flag windows -lgdi32 -lshell32 -lglfw3 +#flag mingw -mwindows #include // #flag darwin -framework Carbon // #flag darwin -framework Cocoa