Skip to content

Commit

Permalink
tc_build: llvm: Combine nested if statement
Browse files Browse the repository at this point in the history
  tc_build/llvm.py:232:9: SIM102 Use a single `if` statement instead of nested `if` statements

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Feb 27, 2023
1 parent 5cf3ec4 commit 15882f6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tc_build/llvm.py
Expand Up @@ -229,12 +229,11 @@ def configure(self):
self.cmake_defines['CMAKE_INSTALL_PREFIX'] = self.folders.install

self.cmake_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(self.projects)
if self.project_is_enabled('compiler-rt'):
# execinfo.h might not exist (Alpine Linux) but the GWP ASAN library
# depends on it. Disable the option to avoid breaking the build, the
# kernel does not depend on it.
if not Path('/usr/include/execinfo.h').exists():
self.cmake_defines['COMPILER_RT_BUILD_GWP_ASAN'] = 'OFF'
# execinfo.h might not exist (Alpine Linux) but the GWP ASAN library
# depends on it. Disable the option to avoid breaking the build, the
# kernel does not depend on it.
if self.project_is_enabled('compiler-rt') and not Path('/usr/include/execinfo.h').exists():
self.cmake_defines['COMPILER_RT_BUILD_GWP_ASAN'] = 'OFF'
if self.cmake_defines['CMAKE_BUILD_TYPE'] == 'Release':
self.cmake_defines['LLVM_ENABLE_WARNINGS'] = 'OFF'
if self.tools.llvm_tblgen:
Expand Down

0 comments on commit 15882f6

Please sign in to comment.