Skip to content
0.2.0-dev Download ZIP
73 lines ·1.6 KB Raw
1#!/usr/bin/env python
2from misc.utility.scons_hints import *
3
4Import("env")
5Import("env_modules")
6
7env_vorbis = env_modules.Clone()
8
9# Thirdparty source files
10
11thirdparty_obj = []
12
13if env["builtin_libvorbis"]:
14 thirdparty_dir = "#thirdparty/libvorbis/"
15 thirdparty_sources = [
16 # "barkmel.c",
17 "bitrate.c",
18 "block.c",
19 "codebook.c",
20 "envelope.c",
21 "floor0.c",
22 "floor1.c",
23 "info.c",
24 "lookup.c",
25 "lpc.c",
26 "lsp.c",
27 "mapping0.c",
28 "mdct.c",
29 "psy.c",
30 # "psytune.c",
31 "registry.c",
32 "res0.c",
33 "sharedbook.c",
34 "smallft.c",
35 "synthesis.c",
36 # "tone.c",
37 "vorbisfile.c",
38 "window.c",
39 ]
40
41 if env.editor_build:
42 thirdparty_sources += [
43 "analysis.c",
44 "vorbisenc.c",
45 ]
46
47 thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
48
49 env_vorbis.Prepend(CPPPATH=[thirdparty_dir])
50
51 # also requires libogg
52 if env["builtin_libogg"]:
53 env_vorbis.Prepend(CPPPATH=["#thirdparty/libogg"])
54
55 env_thirdparty = env_vorbis.Clone()
56 env_thirdparty.disable_warnings()
57 env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
58 env.modules_sources += thirdparty_obj
59
60
61# Godot source files
62
63module_obj = []
64
65env_vorbis.add_source_files(module_obj, "*.cpp")
66
67if env.editor_build:
68 env_vorbis.add_source_files(module_obj, "editor/*.cpp")
69
70env.modules_sources += module_obj
71
72# Needed to force rebuilding the module files when the thirdparty library is updated.
73env.Depends(module_obj, thirdparty_obj)