libclang-static-build: a standalone, static libclang distro that works.

cmake_minimum_required(VERSION 3.13)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)

set(LIBCLANG_INSTALL "libclang-copied")
ExternalProject_Add(libclang-static-build
DOWNLOAD_DIR "libclang-static-build"
INSTALL_DIR "${LIBCLANG_INSTALL}"
GIT_REPOSITORY "https://github.com/deech/libclang-static-build"
GIT_TAG "0cae8e85ef1ad951e1bb560e1eadcd64b2f0828e"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${LIBCLANG_INSTALL}"
)

project(noglob)
add_compile_options("-fno-rtti")

add_executable(noglob
DisallowGlobals.cpp
DisallowNewDelete.cpp
DisallowNonAbstract.cpp
DisallowCoupling.cpp
tool.cpp
)

ExternalProject_Get_Property(libclang-static-build binary_dir)

include_directories(
${binary_dir}/_deps/clang_sources-src/include
${binary_dir}/_deps/libclang_prebuilt-src/include
)

add_dependencies(noglob libclang-static-build)
target_link_libraries(noglob "-L${binary_dir}" "-lclang_static_bundled" -lpthread)

An old programmer learning new tricks.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The 6 levels of Front-end Development Automation

2 things I wish I knew before I started to code.

How to pass CKS — Kubernetes Security Specialist exam. Part 6

Plausible: Self-Hosted Analytics

What the f*ck is a Snuffleupagus?

How to Implement Custom Token-Based Authentication in Spring Boot and Kotlin

Low-code versus traditional development: A primer for independent software vendors

𝟏𝟎 𝐑𝐮𝐥𝐞𝐬 𝐨𝐟 𝐒𝐮𝐜𝐜𝐞𝐬𝐬 𝐁𝐲 𝔼𝕝𝕠𝕟 𝕄𝕦𝕤𝕜:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
art yerkes

art yerkes

An old programmer learning new tricks.

More from Medium

Bluetooth on Your ESP32

What is Egyptian fraction problem?

C++ | Dynamic memory allocation | New Vs Malloc

Shader programming 101