Michael Spencer
2010-Sep-09 00:39 UTC
[LLVMdev] [PATCH][CMake] Removing LLVMLibDeps.cmake and exporting libraries for CMake clients.
While implementing the object file library I ran into some weird linking issues. It turned out that you have to manually specify extra library dependencies in LLVMLibDeps.cmake, along with what you already specify in the CMakeLists.txt file for the component. The attached patches remove this requirement, and add real CMake package export capabilities. A CMake user wishing to use LLVM can now use something similar to this: cmake_minimum_required(VERSION 2.8) find_package(LLVM REQUIRED) add_definitions(${LLVM_CXXFLAGS}) add_executable(llvm-external-test llvm-external-test.cpp) target_link_libraries(llvm-external-test ${LLVM_SYSTEM_LIBS} ${LLVM_JIT_LIBS} ${LLVM_NATIVECODEGEN_LIBS}) llvm+clang compile with these changes on both Linux and MSVS. Currently both patches must be applied at the same time. I can refactor them into a 3 step process if needed. Does this break anything for anyone? - Michael Spencer -------------- next part -------------- A non-text attachment was scrubbed... Name: remove-LLVMLibDeps.cmake.patch Type: application/octet-stream Size: 46935 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100908/5e129cfc/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: cmake-update-to-match.patch Type: application/octet-stream Size: 9826 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100908/5e129cfc/attachment-0001.obj>
Douglas Gregor
2010-Sep-09 19:02 UTC
[LLVMdev] [PATCH][CMake] Removing LLVMLibDeps.cmake and exporting libraries for CMake clients.
On Sep 8, 2010, at 5:39 PM, Michael Spencer wrote:> While implementing the object file library I ran into some weird > linking issues. It turned out that you have to manually specify extra > library dependencies in LLVMLibDeps.cmake, along with what you already > specify in the CMakeLists.txt file for the component. > > The attached patches remove this requirement, and add real CMake > package export capabilities. A CMake user wishing to use LLVM can now > use something similar to this: > > cmake_minimum_required(VERSION 2.8) > > find_package(LLVM REQUIRED) > add_definitions(${LLVM_CXXFLAGS}) > add_executable(llvm-external-test llvm-external-test.cpp) > target_link_libraries(llvm-external-test ${LLVM_SYSTEM_LIBS} > ${LLVM_JIT_LIBS} ${LLVM_NATIVECODEGEN_LIBS}) > > llvm+clang compile with these changes on both Linux and MSVS. > Currently both patches must be applied at the same time. I can > refactor them into a 3 step process if needed. > > Does this break anything for anyone?I think this is great, and I'd like to see it go in, but I can't test it at the moment because, unfortunately, we collided: I just updated a bunch of CMake dependencies in Clang, so your patch doesn't apply. Can you regenerate and post again? - Doug
Michael Spencer
2010-Sep-09 23:01 UTC
[LLVMdev] [PATCH][CMake] Removing LLVMLibDeps.cmake and exporting libraries for CMake clients.
On Thu, Sep 9, 2010 at 3:02 PM, Douglas Gregor <dgregor at apple.com> wrote:> > On Sep 8, 2010, at 5:39 PM, Michael Spencer wrote: > >> While implementing the object file library I ran into some weird >> linking issues. It turned out that you have to manually specify extra >> library dependencies in LLVMLibDeps.cmake, along with what you already >> specify in the CMakeLists.txt file for the component. >> >> The attached patches remove this requirement, and add real CMake >> package export capabilities. A CMake user wishing to use LLVM can now >> use something similar to this: >> >> cmake_minimum_required(VERSION 2.8) >> >> find_package(LLVM REQUIRED) >> add_definitions(${LLVM_CXXFLAGS}) >> add_executable(llvm-external-test llvm-external-test.cpp) >> target_link_libraries(llvm-external-test ${LLVM_SYSTEM_LIBS} >> ${LLVM_JIT_LIBS} ${LLVM_NATIVECODEGEN_LIBS}) >> >> llvm+clang compile with these changes on both Linux and MSVS. >> Currently both patches must be applied at the same time. I can >> refactor them into a 3 step process if needed. >> >> Does this break anything for anyone? > > I think this is great, and I'd like to see it go in, but I can't test it at the moment because, unfortunately, we collided: I just updated a bunch of CMake dependencies in Clang, so your patch doesn't apply. Can you regenerate and post again? > > - DougAttached is the clang patch against r113524. - Michael Spencer -------------- next part -------------- A non-text attachment was scrubbed... Name: clang-cmake-upate-to-match.patch Type: application/octet-stream Size: 18075 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100909/859c475d/attachment.obj>
Seemingly Similar Threads
- [LLVMdev] [PATCH][CMake] Removing LLVMLibDeps.cmake and exporting libraries for CMake clients.
- Embedding llvm as a git submodule in Project
- Embedding llvm as a git submodule in Project
- Embedding llvm as a git submodule in Project
- Building A Project Against LLVM