[runtimes] Don't override LLVM_ENABLE_PER_TARGET_RUNTIME_DIR set from llvm
authorDavid Spickett <david.spickett@linaro.org>
Wed, 7 Dec 2022 14:25:42 +0000 (14:25 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Thu, 2 Feb 2023 11:33:46 +0000 (11:33 +0000)
commitd2375f32c75a364773085a37b6a981305f984d4c
tree116233cdadf945c8b6a38ded6769281c3ac2694b
parentda4a5a46b3c86df436d37f81c0b7849f93d7fbde
[runtimes] Don't override LLVM_ENABLE_PER_TARGET_RUNTIME_DIR set from llvm

LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is set in llvm/CMakeLists.txt
and in llvm/runtimes/CMakeLists.txt.

This meant that anything you passed down, or any platform not using
this layout yet would have it enabled despite it being OFF earlier.

To fix this, check if we have already defined the variable
and if so, use that value.

bultin_register_target I don't fully understand the purpose of.
So for now I have left it setting the value to ON. The rest will
respect what was previously set.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D139536
llvm/runtimes/CMakeLists.txt