From 103b9724f9d4ed91a675b46d0f2fe4420fedd210 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 6 May 2024 15:36:26 +0300 Subject: [PATCH] scripts: waifulib: compiler_optimizations: fix linking OpenMP --- scripts/waifulib/compiler_optimizations.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/waifulib/compiler_optimizations.py b/scripts/waifulib/compiler_optimizations.py index 908dad1a..00bc62a5 100644 --- a/scripts/waifulib/compiler_optimizations.py +++ b/scripts/waifulib/compiler_optimizations.py @@ -127,6 +127,11 @@ OPENMP_CFLAGS = { 'msvc': ['/openmp'] } +OPENMP_LINKFLAGS = { + 'gcc': ['-fopenmp'], + 'clang': ['-fopenmp'], +} + PROFILE_GENERATE_CFLAGS = { 'gcc': ['-fprofile-generate=xash3d-prof'], } @@ -214,6 +219,7 @@ def get_optimization_flags(conf): cflags += conf.get_flags_by_compiler(POLLY_CFLAGS, conf.env.COMPILER_CC) if conf.options.OPENMP: + linkflags+= conf.get_flags_by_compiler(OPENMP_LINKFLAGS, conf.env.COMPILER_CC) cflags += conf.get_flags_by_compiler(OPENMP_CFLAGS, conf.env.COMPILER_CC) if conf.options.PROFILE_GENERATE: