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

compiler: enable FreeBSD's cflags for freetype & glfw

This commit is contained in:
sunnylcw 2019-09-28 19:18:04 +08:00 committed by Alexander Medvednikov
parent 366c50674c
commit 4b03abdaff
3 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ fn (v &V) get_os_cflags() []CFlag {
if flag.os == '' if flag.os == ''
|| (flag.os == 'linux' && v.os == .linux) || (flag.os == 'linux' && v.os == .linux)
|| (flag.os == 'darwin' && v.os == .mac) || (flag.os == 'darwin' && v.os == .mac)
|| (flag.os == 'freebsd' && v.os == .freebsd)
|| (flag.os == 'windows' && (v.os == .windows || v.os == .msvc)) { || (flag.os == 'windows' && (v.os == .windows || v.os == .msvc)) {
flags << flag flags << flag
} }
@ -81,7 +82,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
} }
mut fos := '' mut fos := ''
mut name := '' mut name := ''
if flag.starts_with('linux') || flag.starts_with('darwin') || flag.starts_with('windows') { if flag.starts_with('linux') || flag.starts_with('darwin') || flag.starts_with('freebsd') || flag.starts_with('windows') {
pos := flag.index(' ') pos := flag.index(' ')
fos = flag.left(pos).trim_space() fos = flag.left(pos).trim_space()
flag = flag.right(pos).trim_space() flag = flag.right(pos).trim_space()

View File

@ -17,6 +17,8 @@ import (
#flag darwin -I/usr/local/include/freetype2 #flag darwin -I/usr/local/include/freetype2
#flag darwin -I/opt/local/include/freetype2 #flag darwin -I/opt/local/include/freetype2
#flag freebsd -I/usr/local/include/freetype2
#flag freebsd -Wl,-L/usr/local/lib
#flag -lfreetype #flag -lfreetype
//#flag -I @VROOT/thirdparty/freetype //#flag -I @VROOT/thirdparty/freetype

View File

@ -18,6 +18,8 @@ import gl
#flag darwin -L/opt/local/lib #flag darwin -L/opt/local/lib
#flag darwin -lglfw #flag darwin -lglfw
#flag freebsd -I/usr/local/include
#flag freebsd -Wl,-L/usr/local/lib,-lglfw
#flag linux -lglfw #flag linux -lglfw
#flag windows -lglfw3 #flag windows -lglfw3
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>