Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 1 | # Copyright (c) 2016, 2017 ARM Limited. |
| 2 | # |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | # of this software and associated documentation files (the "Software"), to |
| 7 | # deal in the Software without restriction, including without limitation the |
| 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 9 | # sell copies of the Software, and to permit persons to whom the Software is |
| 10 | # furnished to do so, subject to the following conditions: |
| 11 | # |
| 12 | # The above copyright notice and this permission notice shall be included in all |
| 13 | # copies or substantial portions of the Software. |
| 14 | # |
| 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | # SOFTWARE. |
| 22 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 23 | import SCons |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 24 | import os |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 25 | import subprocess |
| 26 | |
| 27 | def version_at_least(version, required): |
| 28 | end = min(len(version), len(required)) |
| 29 | |
| 30 | for i in range(0, end, 2): |
| 31 | if int(version[i]) < int(required[i]): |
| 32 | return False |
| 33 | elif int(version[i]) > int(required[i]): |
| 34 | return True |
| 35 | |
| 36 | return True |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 37 | |
| 38 | vars = Variables("scons") |
| 39 | vars.AddVariables( |
| 40 | BoolVariable("debug", "Debug", False), |
| 41 | BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False), |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 42 | BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False), |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 43 | EnumVariable("arch", "Target Architecture", "armv7a", allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "x86_32", "x86_64")), |
| 44 | EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "bare_metal")), |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 45 | EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")), |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 46 | BoolVariable("examples", "Build example programs", True), |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 47 | BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True), |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 48 | BoolVariable("standalone", "Builds the tests as standalone executables, links statically with libgcc, libstdc++ and libarm_compute", False), |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 49 | BoolVariable("opencl", "Enable OpenCL support", True), |
| 50 | BoolVariable("neon", "Enable Neon support", False), |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 51 | BoolVariable("gles_compute", "Enable OpenGL ES Compute Shader support", False), |
Anthony Barbier | f45d5a9 | 2018-01-24 16:23:15 +0000 | [diff] [blame] | 52 | BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", True), |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 53 | BoolVariable("set_soname", "Set the library's soname and shlibversion (requires SCons 2.4 or above)", False), |
| 54 | BoolVariable("openmp", "Enable OpenMP backend", False), |
| 55 | BoolVariable("cppthreads", "Enable C++11 threads backend", True), |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 56 | PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept), |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 57 | ("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""), |
| 58 | ("compiler_cache", "Command to prefix to the C and C++ compiler (e.g ccache)", "") |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 59 | ) |
| 60 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 61 | env = Environment(platform="posix", variables=vars, ENV = os.environ) |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 62 | env.Append(LIBPATH = ["#build/%s" % env['build_dir']]) |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 63 | Export('env') |
| 64 | Export('vars') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 65 | |
| 66 | SConsignFile('build/.%s' % env['build_dir']) |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 67 | |
| 68 | Help(vars.GenerateHelpText(env)) |
| 69 | |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 70 | if env['build'] == "embed_only": |
| 71 | SConscript('./SConscript', variant_dir='#build/%s' % env['build_dir'], duplicate=0) |
| 72 | Return() |
| 73 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 74 | if env['neon'] and 'x86' in env['arch']: |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 75 | print("Cannot compile NEON for x86") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 76 | Exit(1) |
| 77 | |
| 78 | if env['set_soname'] and not version_at_least(SCons.__version__, "2.4"): |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 79 | print("Setting the library's SONAME / SHLIBVERSION requires SCons 2.4 or above") |
| 80 | print("Update your version of SCons or use set_soname=0") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 81 | Exit(1) |
| 82 | |
| 83 | if env['os'] == 'bare_metal': |
| 84 | if env['cppthreads'] or env['openmp']: |
| 85 | print("ERROR: OpenMP and C++11 threads not supported in bare_metal. Use cppthreads=0 openmp=0") |
| 86 | Exit(1) |
| 87 | |
| 88 | env.Append(CXXFLAGS = ['-Wno-deprecated-declarations','-Wall','-DARCH_ARM', |
| 89 | '-Wextra','-Wno-unused-parameter','-pedantic','-Wdisabled-optimization','-Wformat=2', |
| 90 | '-Winit-self','-Wstrict-overflow=2','-Wswitch-default', |
| 91 | '-fpermissive','-std=gnu++11','-Wno-vla','-Woverloaded-virtual', |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame^] | 92 | '-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-format-nonliteral','-Wno-overlength-strings','-Wno-strict-overflow']) |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 93 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 94 | env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP']) |
| 95 | |
Anthony Barbier | f45d5a9 | 2018-01-24 16:23:15 +0000 | [diff] [blame] | 96 | default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++' |
| 97 | default_c_compiler = 'gcc' if env['os'] != 'android' else 'clang' |
| 98 | cpp_compiler = os.environ.get('CXX', default_cpp_compiler) |
| 99 | c_compiler = os.environ.get('CC', default_c_compiler) |
| 100 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 101 | if env['os'] == 'android' and ( 'clang++' not in cpp_compiler or 'clang' not in c_compiler ): |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 102 | print( "WARNING: Only clang is officially supported to build the Compute Library for Android") |
Anthony Barbier | f45d5a9 | 2018-01-24 16:23:15 +0000 | [diff] [blame] | 103 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 104 | if 'clang++' in cpp_compiler: |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 105 | env.Append(CXXFLAGS = ['-Wno-format-nonliteral','-Wno-deprecated-increment-bool','-Wno-vla-extension','-Wno-mismatched-tags']) |
| 106 | else: |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame^] | 107 | env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel','-Wno-implicit-fallthrough']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 108 | |
| 109 | if env['cppthreads']: |
| 110 | env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)]) |
| 111 | |
| 112 | if env['openmp']: |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 113 | if 'clang++' in cpp_compiler: |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 114 | print( "Clang does not support OpenMP. Use scheduler=cpp.") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 115 | Exit(1) |
| 116 | |
| 117 | env.Append(CPPDEFINES = [('ARM_COMPUTE_OPENMP_SCHEDULER', 1)]) |
| 118 | env.Append(CXXFLAGS = ['-fopenmp']) |
| 119 | env.Append(LINKFLAGS = ['-fopenmp']) |
| 120 | |
| 121 | prefix = "" |
| 122 | if env['arch'] == 'armv7a': |
| 123 | env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon']) |
| 124 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 125 | if env['os'] == 'linux': |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 126 | prefix = "arm-linux-gnueabihf-" |
| 127 | env.Append(CXXFLAGS = ['-mfloat-abi=hard']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 128 | elif env['os'] == 'bare_metal': |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 129 | prefix = "arm-eabi-" |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 130 | env.Append(CXXFLAGS = ['-mfloat-abi=hard']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 131 | elif env['os'] == 'android': |
| 132 | prefix = "arm-linux-androideabi-" |
| 133 | env.Append(CXXFLAGS = ['-mfloat-abi=softfp']) |
| 134 | elif env['arch'] == 'arm64-v8a': |
| 135 | env.Append(CXXFLAGS = ['-march=armv8-a']) |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 136 | env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8A','NO_DOT_IN_TOOLCHAIN']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 137 | if env['os'] == 'linux': |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 138 | prefix = "aarch64-linux-gnu-" |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 139 | elif env['os'] == 'bare_metal': |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 140 | prefix = "aarch64-elf-" |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 141 | elif env['os'] == 'android': |
| 142 | prefix = "aarch64-linux-android-" |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 143 | if 'clang++' in cpp_compiler: |
| 144 | env.Append(CXXFLAGS = ['-no-integrated-as']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 145 | elif env['arch'] == 'arm64-v8.2-a': |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 146 | env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __ARM_FEATURE_FP16_VECTOR_ARITHMETIC is undefined |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 147 | env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2','NO_DOT_IN_TOOLCHAIN']) |
| 148 | if 'clang++' in cpp_compiler: |
| 149 | env.Append(CXXFLAGS = ['-no-integrated-as']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 150 | if env['os'] == 'linux': |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 151 | prefix = "aarch64-linux-gnu-" |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 152 | elif env['os'] == 'bare_metal': |
| 153 | prefix = "aarch64-elf-" |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 154 | elif env['os'] == 'android': |
| 155 | prefix = "aarch64-linux-android-" |
| 156 | elif env['arch'] == 'x86_32': |
| 157 | env.Append(CCFLAGS = ['-m32']) |
| 158 | env.Append(LINKFLAGS = ['-m32']) |
| 159 | elif env['arch'] == 'x86_64': |
| 160 | env.Append(CCFLAGS = ['-m64']) |
| 161 | env.Append(LINKFLAGS = ['-m64']) |
| 162 | |
| 163 | if env['build'] == 'native': |
| 164 | prefix = "" |
| 165 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 166 | env['CC'] = env['compiler_cache']+" "+prefix + c_compiler |
| 167 | env['CXX'] = env['compiler_cache']+" "+prefix + cpp_compiler |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 168 | env['LD'] = prefix + "ld" |
| 169 | env['AS'] = prefix + "as" |
| 170 | env['AR'] = prefix + "ar" |
| 171 | env['RANLIB'] = prefix + "ranlib" |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 172 | |
| 173 | if not GetOption("help"): |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 174 | try: |
bradford barr | 8d418ab | 2017-08-07 14:17:09 -0400 | [diff] [blame] | 175 | compiler_ver = subprocess.check_output(env['CXX'].split() + ["-dumpversion"]).strip() |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 176 | except OSError: |
| 177 | print("ERROR: Compiler '%s' not found" % env['CXX']) |
| 178 | Exit(1) |
| 179 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 180 | if 'clang++' not in cpp_compiler: |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 181 | if env['arch'] == 'arm64-v8.2-a' and not version_at_least(compiler_ver, '6.2.1'): |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 182 | print("GCC 6.2.1 or newer is required to compile armv8.2-a code") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 183 | Exit(1) |
| 184 | elif env['arch'] == 'arm64-v8a' and not version_at_least(compiler_ver, '4.9'): |
ggardet | e2542c9 | 2018-06-29 17:01:01 +0200 | [diff] [blame] | 185 | print("GCC 4.9 or newer is required to compile NEON code for AArch64") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 186 | Exit(1) |
| 187 | |
| 188 | if version_at_least(compiler_ver, '6.1'): |
| 189 | env.Append(CXXFLAGS = ['-Wno-ignored-attributes']) |
| 190 | |
| 191 | if compiler_ver == '4.8.3': |
| 192 | env.Append(CXXFLAGS = ['-Wno-array-bounds']) |
| 193 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 194 | if env['standalone']: |
| 195 | env.Append(CXXFLAGS = ['-fPIC']) |
| 196 | env.Append(LINKFLAGS = ['-static-libgcc','-static-libstdc++']) |
| 197 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 198 | if env['Werror']: |
| 199 | env.Append(CXXFLAGS = ['-Werror']) |
| 200 | |
| 201 | if env['os'] == 'android': |
| 202 | env.Append(CPPDEFINES = ['ANDROID']) |
| 203 | env.Append(LINKFLAGS = ['-pie', '-static-libstdc++']) |
| 204 | elif env['os'] == 'bare_metal': |
| 205 | env.Append(LINKFLAGS = ['-static']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 206 | env.Append(LINKFLAGS = ['-specs=rdimon.specs']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 207 | env.Append(CXXFLAGS = ['-fPIC']) |
| 208 | env.Append(CPPDEFINES = ['NO_MULTI_THREADING']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 209 | env.Append(CPPDEFINES = ['BARE_METAL']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 210 | |
| 211 | if env['opencl']: |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 212 | if env['os'] in ['bare_metal'] or env['standalone']: |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 213 | print("Cannot link OpenCL statically, which is required for bare metal / standalone builds") |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 214 | Exit(1) |
| 215 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 216 | if env['gles_compute']: |
| 217 | if env['os'] in ['bare_metal'] or env['standalone']: |
| 218 | print("Cannot link OpenGLES statically, which is required for bare metal / standalone builds") |
| 219 | Exit(1) |
| 220 | |
| 221 | if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']): |
| 222 | env.Append(LIBS = ['pthread']) |
| 223 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 224 | if env['opencl'] or env['gles_compute']: |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 225 | if env['embed_kernels']: |
| 226 | env.Append(CPPDEFINES = ['EMBEDDED_KERNELS']) |
| 227 | |
| 228 | if env['debug']: |
| 229 | env['asserts'] = True |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 230 | env['logging'] = True |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 231 | env.Append(CXXFLAGS = ['-O0','-g','-gdwarf-2']) |
| 232 | env.Append(CPPDEFINES = ['ARM_COMPUTE_DEBUG_ENABLED']) |
| 233 | else: |
| 234 | env.Append(CXXFLAGS = ['-O3','-ftree-vectorize']) |
| 235 | |
| 236 | if env['asserts']: |
| 237 | env.Append(CPPDEFINES = ['ARM_COMPUTE_ASSERTS_ENABLED']) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 238 | env.Append(CXXFLAGS = ['-fstack-protector-strong']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 239 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 240 | if env['logging']: |
| 241 | env.Append(CPPDEFINES = ['ARM_COMPUTE_LOGGING_ENABLED']) |
| 242 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 243 | env.Append(CPPPATH = ['#/include', "#"]) |
| 244 | env.Append(CXXFLAGS = env['extra_cxx_flags']) |
| 245 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 246 | Export('version_at_least') |
| 247 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 248 | if env['opencl']: |
| 249 | SConscript("./opencl-1.2-stubs/SConscript", variant_dir="build/%s/opencl-1.2-stubs" % env['build_dir'], duplicate=0) |
| 250 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 251 | if env['gles_compute'] and env['os'] != 'android': |
| 252 | env.Append(CPPPATH = ['#/include/linux']) |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 253 | SConscript("./opengles-3.1-stubs/SConscript", variant_dir="build/%s/opengles-3.1-stubs" % env['build_dir'], duplicate=0) |
| 254 | |
| 255 | SConscript('./SConscript', variant_dir='#build/%s' % env['build_dir'], duplicate=0) |
| 256 | |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 257 | if env['examples'] and env['os'] != 'bare_metal': |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 258 | SConscript('./examples/SConscript', variant_dir='#build/%s/examples' % env['build_dir'], duplicate=0) |
| 259 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 260 | if env['os'] != 'bare_metal': |
| 261 | SConscript('./tests/SConscript', variant_dir='#build/%s/tests' % env['build_dir'], duplicate=0) |