代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。