pref: fix handling of _d_custom.v files, use it in vlib/sokol/f/f_d_use_freetype.v

pull/8292/head
Delyan Angelov 2021-01-23 11:21:56 +02:00
parent 8b61891348
commit a3908414e4
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 24 additions and 25 deletions

View File

@ -7,30 +7,6 @@ pub const (
used_import = fontstash.used_import + c.used_import
)
/*
#flag windows -I @VROOT/thirdparty/freetype/include
#flag windows -L @VROOT/thirdparty/freetype/win64
#flag linux -I/usr/include/freetype2
#flag darwin -I/usr/local/include/freetype2
// MacPorts
#flag darwin -I/opt/local/include/freetype2
#flag darwin -L/opt/local/lib
#flag freebsd -I/usr/local/include/freetype2
#flag freebsd -Wl -L/usr/local/lib
#flag windows -lfreetype
#flag linux -lfreetype
#flag darwin -lfreetype
#flag darwin -lpng -lbz2 -lz
*/
#flag linux -I.
//#include "ft2build.h"

View File

@ -0,0 +1,20 @@
module f
#define FONS_USE_FREETYPE
#flag windows -I @VROOT/thirdparty/freetype/include
#flag windows -L @VROOT/thirdparty/freetype/win64
#flag linux -I/usr/include/freetype2
#flag darwin -I/usr/local/include/freetype2
// MacPorts
#flag darwin -I/opt/local/include/freetype2
#flag darwin -L/opt/local/lib
#flag freebsd -I/usr/local/include/freetype2
#flag freebsd -Wl -L/usr/local/lib
#flag windows -lfreetype
#flag linux -lfreetype
#flag darwin -lfreetype
#flag darwin -lpng -lbz2 -lz

View File

@ -20,7 +20,10 @@ pub fn (prefs &Preferences) should_compile_filtered_files(dir string, files_ []s
if prefs.backend == .js && !prefs.should_compile_js(file) {
continue
}
if prefs.compile_defines_all.len > 0 && file.contains('_d_') {
if file.contains('_d_') {
if prefs.compile_defines_all.len == 0 {
continue
}
mut allowed := false
for cdefine in prefs.compile_defines {
file_postfix := '_d_${cdefine}.v'