加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
devotes 提交于 2024-07-24 02:24 . add code
cmake_minimum_required(VERSION 3.10)
project(ccana)
# set cxx standard is c++ 17
set(CMAKE_CXX_STANDARD 17)
# set the shared library file output path is ${BUILD_DIR}/lib
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# set the static library file output path is ${BUILD_DIR}/lib
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# set the executable file output path is ${BUILD_DIR}/bin
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# need llvm help
find_package(LLVM 12 REQUIRED CONFIG)
# add src file to marco
file(GLOB CCAPA_SRCS ${CMAKE_SOURCE_DIR}/src/*.cpp)
# add executable file
add_executable(${PROJECT_NAME} ${CCAPA_SRCS})
# include llvm dirs
target_include_directories(${PROJECT_NAME}
PRIVATE ${LLVM_INCLUDE_DIRS}
PRIVATE ${CMAKE_SOURCE_DIR}/include
PRIVATE ${CMAKE_SOURCE_DIR}/third_party/cxxopts
PRIVATE ${CMAKE_SOURCE_DIR}/third_party/jsoncpp/include
)
# link llvm librarys
target_link_libraries(${PROJECT_NAME}
PRIVATE LLVMCore LLVMSupport LLVMIRReader LLVMBitReader jsoncpp
)
add_subdirectory(third_party)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化