mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
"#flag mingw ..." support
This commit is contained in:
parent
07921194f2
commit
0df6eaa927
@ -25,7 +25,7 @@ fn (v &V) get_os_cflags() []CFlag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for flag in v.table.cflags {
|
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
|
flags << flag
|
||||||
}
|
}
|
||||||
if flag.os in ctimedefines {
|
if flag.os in ctimedefines {
|
||||||
@ -82,7 +82,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string, ctimedefines []string
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
mut fos := ''
|
mut fos := ''
|
||||||
mut allowed_os_overrides := ['linux','darwin','freebsd','windows']
|
mut allowed_os_overrides := ['linux', 'darwin', 'freebsd', 'windows', 'mingw']
|
||||||
allowed_os_overrides << ctimedefines
|
allowed_os_overrides << ctimedefines
|
||||||
for os_override in allowed_os_overrides {
|
for os_override in allowed_os_overrides {
|
||||||
if !flag.starts_with( os_override ) { continue }
|
if !flag.starts_with( os_override ) { continue }
|
||||||
|
@ -22,6 +22,7 @@ import gl
|
|||||||
#flag freebsd -Wl,-L/usr/local/lib,-lglfw
|
#flag freebsd -Wl,-L/usr/local/lib,-lglfw
|
||||||
#flag linux -lglfw
|
#flag linux -lglfw
|
||||||
#flag windows -lgdi32 -lshell32 -lglfw3
|
#flag windows -lgdi32 -lshell32 -lglfw3
|
||||||
|
#flag mingw -mwindows
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
// #flag darwin -framework Carbon
|
// #flag darwin -framework Carbon
|
||||||
// #flag darwin -framework Cocoa
|
// #flag darwin -framework Cocoa
|
||||||
|
Loading…
Reference in New Issue
Block a user