Commit 8cef397d by Ben Clayton

CMake: Don't export LLVM_INCLUDE_DIR to PARENT_SCOPE

The base change moved the LLVM rules out to a separate CMakeLists.txt file, while trying to keep the behaviour as close as possible to original. `LLVM_INCLUDE_DIR` is not needed to be exposed if we made it a public include directory on the llvm target, so do that. Bug: b/145758253 Bug: b/152339534 Change-Id: I6e409da409d9a28847ac5bb4074899d70bb38145 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/42971Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent 434a9164
......@@ -593,7 +593,7 @@ endif()
###########################################################
# LLVM
###########################################################
add_subdirectory(third_party/llvm-7.0) # TODO(bclayton): This currently exports the LLVM_INCLUDE_DIR var. Don't.
add_subdirectory(third_party/llvm-7.0)
###########################################################
......@@ -771,7 +771,6 @@ endif()
set(COMMON_INCLUDE_DIR
${SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${LLVM_INCLUDE_DIR}
${LIBBACKTRACE_INCLUDE_DIR}
)
set(OPENGL_INCLUDE_DIR
......
......@@ -975,16 +975,9 @@ set_target_properties(llvm PROPERTIES
COMPILE_DEFINITIONS "__STDC_CONSTANT_MACROS; __STDC_LIMIT_MACROS;"
FOLDER "LLVM"
)
target_include_directories(llvm PUBLIC "${LLVM_INCLUDE_DIR}")
# Add required libraries for LLVM
if(LINUX)
target_link_libraries(llvm dl)
endif()
###########################################################
# Publics
###########################################################
# TODO(bclayton): Remove this and replace with:
# target_include_directories(llvm PUBLIC "${LLVM_INCLUDE_DIR}")
set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} PARENT_SCOPE)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment