forked from Autodesk/arnold-usd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscript
executable file
·70 lines (59 loc) · 2 KB
/
SConscript
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
66
67
68
69
70
# vim: filetype=python
# Copyright 2022 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## load our own python modules
from utils import system
from utils.build_tools import find_files_recursive, link_usd_libraries
from utils import dependencies
import os
# import build env
Import('env')
local_env = env.Clone()
# Automatically add all source and include files found in the source path
src_base_dir = os.path.join(local_env['ROOT_DIR'], 'translator')
source_files = find_files_recursive(src_base_dir, ['.c', '.cpp'])
# Compiler flags
if system.os != 'windows':
local_env.Append(CXXFLAGS = Split('-fPIC -Wno-deprecated-register'))
local_env.Append(CPPPATH = ['.'])
local_env.Append(LIBS = ['ai'])
usd_deps = []
if local_env['USD_BUILD_MODE'] == 'monolithic':
usd_deps = [
local_env['USD_MONOLITHIC_LIBRARY'],
]
elif local_env['USD_BUILD_MODE'] == 'shared_libs':
usd_libs = [
'sdf',
'tf',
'usd',
'ar',
'pcp',
'usdGeom',
'usdShade',
'usdUtils',
'vt',
'usdLux',
'usdVol',
'usdSkel',
'usdRender',
'work'
]
usd_libs, usd_sources = link_usd_libraries(local_env, usd_libs)
usd_deps = usd_deps + usd_libs
source_files = source_files + usd_sources
local_env.Append(LIBS = usd_deps)
# Build shared library for the Alembic procedural
USD_TRANSLATOR = local_env.StaticLibrary('usd_translator', dependencies.add_common_src(local_env, 'translator', source_files))
Return('USD_TRANSLATOR')