-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
65 lines (56 loc) · 1.83 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from subprocess import Popen,PIPE
import sys
out="./build"
def exe(cmd):
return Popen(cmd.split(), stdout=PIPE).stdout.read().decode("utf8").strip()
def options(opt):
opt.load("compiler_cxx")
def configure(cnf):
cnf.load("compiler_cxx")
cnf.find_program("freetype-config", var="FTCNF")
cnf.check_cfg(
path="freetype-config",
args="--cflags --libs",
package="",
uselib_store="freetype"
)
if (sys.platform.startswith("win") or sys.platform.startswith("cygwin")):
print("for windows, I don't get path for fonts.")
pass
elif (sys.platform.startswith("darwin")):
ttfs = exe("find /Library/Fonts -name *.ttf")
for ttf in ttfs.split("\n"):
if ("gothic" in ttf or "Gothic" in ttf):
cnf.env.append_unique("DEFINES", ["_DFONT=\"%s\""%ttf])
print("set font:", ttf)
break
else:
print("could not find font file.")
print("please set manually")
else:
ttfs = exe("find /usr/share/fonts -name *.ttf")
for ttf in ttfs.split("\n"):
if ("gothic" in ttf or "Gothic" in ttf):
cnf.env.append_unique("DEFINES", ["_DFONT=\"%s\""%ttf])
print("set font:", ttf)
break
else:
print("could not find font file.")
print("please set manually")
def build(bld):
bld(
features="cxx cxxprogram",
cxxflags="-Wall -std=c++11",
source="RNAlogo/main_sample.cpp",
include="RNAlogo",
target="bin/RNAlogo-sample",
uselib="freetype",
)
bld(
features="cxx cxxprogram",
cxxflags="-Wall -std=c++11",
source="RNAlogo/main_stack.cpp",
include="RNAlogo",
target="bin/RNAlogo-stack",
uselib="freetype",
)