aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct10
1 files changed, 7 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 13f839b324..425c77643a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -94,7 +94,7 @@ vars.AddVariables(
allowed_values=("armv7a", "armv7a-hf", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64",
"armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "armv8.6-a-sve", "armv8.6-a-sve2", "armv8r64", "x86")),
EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
- EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal")),
+ EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal", "openbsd")),
EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
BoolVariable("examples", "Build example programs", True),
BoolVariable("gemm_tuner", "Build gemm_tuner programs", True),
@@ -207,8 +207,8 @@ env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM',
env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
-default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++'
-default_c_compiler = 'gcc' if env['os'] not in ['android', 'macos'] else 'clang'
+default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos', 'openbsd'] else 'clang++'
+default_c_compiler = 'gcc' if env['os'] not in ['android', 'macos', 'openbsd'] else 'clang'
cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
c_compiler = os.environ.get('CC', default_c_compiler)
@@ -427,6 +427,10 @@ if env['opencl']:
if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
env.Append(LIBS = ['pthread'])
+if env['os'] == 'openbsd':
+ env.Append(LIBS = ['c'])
+ env.Append(CXXFLAGS = ['-fPIC'])
+
if env['opencl']:
if env['embed_kernels']:
env.Append(CPPDEFINES = ['EMBEDDED_KERNELS'])