Hi All,
The proposed patch makes possible to use LLVM’s CMake build infrastructure (most importantly add_llvm_library and add_llvm_executable macros) from the project that has llvm in a subdirectory.
For example:
demo/
llvm/
demo.cpp
CMakeLists.txt
where CMakeLists.txt is as follows:
----------------------------- Start of CMakeLists.txt ----------------------------------------
project(DEMO)
cmake_minimum_required(VERSION 2.6.1)
add_subdirectory("${DEMO_SOURCE_DIR}/llvm")
include_directories(
“${LLVM_SOURCE_DIR}/include”
“${LLVM_BINARY_DIR}/include”
)
set(LLVM_LINK_COMPONENTS core jit interpreter native)
add_llvm_executable(DEMO demo.cpp)
----------------------------- End of CMakeLists.txt ----------------------------------------
As you can see with this patch creating a project using CMake outside of the LLVM directory structure is as simple as inside.
To this end I made the following CMake variables stored in cache:
LLVM_COMMON_DEPENDS
LLVM_NATIVE_ARCH
llvm_libs
MSVC_LIB_DEPS_LLVM*
Best regards,
Victor
0001-Save-several-cmake-variables-to-cache-to-support-llv.patch (20.3 KB)