Make the Reactor build target an alias
Previously the Cmake Reactor variable was a symbol to either ReactorLLVM
or ReactorSubzero, requiring the ${Reactor} syntax to dereference it.
This change uses CMake's ability to create new build targets which are
aliases of existing targets:
https://cmake.org/cmake/help/latest/command/add_library.html#alias-libraries
Bug: b/145758253
Change-Id: I5734548668114b1b22a851167913a448d83eabda
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/62328
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4600d3b..4010b79 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -743,9 +743,9 @@
add_subdirectory(src/Reactor) # Add ReactorSubzero and ReactorLLVM targets
if(${REACTOR_BACKEND} STREQUAL "LLVM")
- set(Reactor ReactorLLVM)
+ add_library(Reactor ALIAS ReactorLLVM)
elseif(${REACTOR_BACKEND} STREQUAL "Subzero")
- set(Reactor ReactorSubzero)
+ add_library(Reactor ALIAS ReactorSubzero)
else()
message(FATAL_ERROR "REACTOR_BACKEND must be 'LLVM' or 'Subzero'")
endif()