Created
May 23, 2019 15:05
-
-
Save sheredom/5121d1d34449a83fdc91bbba9ecb9f06 to your computer and use it in GitHub Desktop.
LLVM plugin CMake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LLVM requires C++11. | |
set(CMAKE_CXX_STANDARD 11) | |
# Find LLVM (this looks for LLVMConfig.cmake somewhere in the PATH or LLVM_DIR). | |
find_package(LLVM REQUIRED CONFIG) | |
# Enable us to use the LLVM CMake modules. | |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_CMAKE_DIR}") | |
# Enable us to use add_llvm_library. | |
include(AddLLVM) | |
# Bring in the LLVM include directories. | |
include_directories(${LLVM_INCLUDE_DIRS}) | |
# Bring in any definitions LLVM requires. | |
add_definitions(${LLVM_DEFINITIONS}) | |
# Add a module library that we can plugin to opt. | |
add_llvm_library(my_plugin MODULE plugin.cpp PLUGIN_TOOL opt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment