compiler: enable FreeBSD's cflags for freetype & glfw

pull/2121/head
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 == ''
|| (flag.os == 'linux' && v.os == .linux)
|| (flag.os == 'darwin' && v.os == .mac)
|| (flag.os == 'freebsd' && v.os == .freebsd)
|| (flag.os == 'windows' && (v.os == .windows || v.os == .msvc)) {
flags << flag
}
@ -81,7 +82,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
}
mut fos := ''
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(' ')
fos = flag.left(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/opt/local/include/freetype2
#flag freebsd -I/usr/local/include/freetype2
#flag freebsd -Wl,-L/usr/local/lib
#flag -lfreetype
//#flag -I @VROOT/thirdparty/freetype

View File

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