mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
CMake: support for using LLVM from client projects with find_package.
Patch by arrowdodger! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -436,6 +436,26 @@
|
||||
headers on the LLVM source directory (if we are building
|
||||
out-of-source.)</p>
|
||||
|
||||
<p>Alternativaly, you can utilize CMake's <i>find_package</i>
|
||||
functionality. Here is an equivalent variant of snippet shown above:</p>
|
||||
|
||||
<div class="doc_code">
|
||||
<pre>
|
||||
find_package(LLVM)
|
||||
|
||||
if( NOT LLVM_FOUND )
|
||||
message(FATAL_ERROR "LLVM package can't be found. Set CMAKE_PREFIX_PATH variable to LLVM's installation prefix.")
|
||||
endif()
|
||||
|
||||
include_directories( ${LLVM_INCLUDE_DIRS} )
|
||||
link_directories( ${LLVM_LIBRARY_DIRS} )
|
||||
|
||||
llvm_map_components_to_libraries(REQ_LLVM_LIBRARIES jit native)
|
||||
|
||||
target_link_libraries(mycompiler ${REQ_LLVM_LIBRARIES})
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
|
Reference in New Issue
Block a user