| 1 |
|
| 2 |
from misc.utility.scons_hints import * |
| 3 |
|
| 4 |
Import("env") |
| 5 |
Import("env_modules") |
| 6 |
|
| 7 |
env_msdfgen = env_modules.Clone() |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
thirdparty_obj = [] |
| 12 |
|
| 13 |
if env["builtin_msdfgen"]: |
| 14 |
env_msdfgen.disable_warnings() |
| 15 |
|
| 16 |
thirdparty_dir = "#thirdparty/msdfgen/" |
| 17 |
thirdparty_sources = [ |
| 18 |
"core/Contour.cpp", |
| 19 |
"core/DistanceMapping.cpp", |
| 20 |
"core/EdgeHolder.cpp", |
| 21 |
"core/MSDFErrorCorrection.cpp", |
| 22 |
"core/Projection.cpp", |
| 23 |
"core/Scanline.cpp", |
| 24 |
"core/Shape.cpp", |
| 25 |
"core/contour-combiners.cpp", |
| 26 |
"core/convergent-curve-ordering.cpp", |
| 27 |
"core/edge-coloring.cpp", |
| 28 |
"core/edge-segments.cpp", |
| 29 |
"core/edge-selectors.cpp", |
| 30 |
"core/equation-solver.cpp", |
| 31 |
|
| 32 |
"core/msdf-error-correction.cpp", |
| 33 |
"core/msdfgen.cpp", |
| 34 |
"core/rasterization.cpp", |
| 35 |
"core/render-sdf.cpp", |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
"core/sdf-error-estimation.cpp", |
| 41 |
"core/shape-description.cpp", |
| 42 |
] |
| 43 |
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] |
| 44 |
|
| 45 |
env_msdfgen.Append(CPPDEFINES=[("MSDFGEN_PUBLIC", "")]) |
| 46 |
env_msdfgen.Prepend(CPPPATH=["#thirdparty/freetype/include", "#thirdparty/msdfgen", "#thirdparty/nanosvg"]) |
| 47 |
|
| 48 |
lib = env_msdfgen.add_library("msdfgen_builtin", thirdparty_sources) |
| 49 |
thirdparty_obj += lib |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
inserted = False |
| 56 |
for idx, linklib in enumerate(env["LIBS"]): |
| 57 |
if isinstance(linklib, (str, bytes)): |
| 58 |
env["LIBS"].insert(idx, lib) |
| 59 |
inserted = True |
| 60 |
break |
| 61 |
if not inserted: |
| 62 |
env.Append(LIBS=[lib]) |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
module_obj = [] |
| 68 |
|
| 69 |
env_msdfgen.add_source_files(module_obj, "*.cpp") |
| 70 |
env.modules_sources += module_obj |
| 71 |
|
| 72 |
|
| 73 |
env.Depends(module_obj, thirdparty_obj) |