{"id":13830913,"url":"https://github.com/blockspacer/CXXCTP","last_synced_at":"2025-07-09T13:30:40.750Z","repository":{"id":127447799,"uuid":"204979845","full_name":"blockspacer/CXXCTP","owner":"blockspacer","description":"DEPRECATED. USE INSTEAD github.com/blockspacer/flextool","archived":true,"fork":false,"pushed_at":"2020-05-05T20:19:00.000Z","size":1209,"stargazers_count":58,"open_issues_count":0,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-19T03:32:16.194Z","etag":null,"topics":["clang","cling","cmake","codestyle","conan","cplusplus","cpp","cpp11","cpp14","cpp17","libtooling","llvm","metaclasses","preprocessor","refactoring","reflection","serialization","source-to-source","static-analysis","transpiling"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockspacer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-28T16:49:04.000Z","updated_at":"2024-11-13T09:37:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c50af410-737b-48e8-bbb9-67641883f9ef","html_url":"https://github.com/blockspacer/CXXCTP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blockspacer/CXXCTP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockspacer%2FCXXCTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockspacer%2FCXXCTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockspacer%2FCXXCTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockspacer%2FCXXCTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockspacer","download_url":"https://codeload.github.com/blockspacer/CXXCTP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockspacer%2FCXXCTP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264467893,"owners_count":23612996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","cling","cmake","codestyle","conan","cplusplus","cpp","cpp11","cpp14","cpp17","libtooling","llvm","metaclasses","preprocessor","refactoring","reflection","serialization","source-to-source","static-analysis","transpiling"],"created_at":"2024-08-04T10:01:12.270Z","updated_at":"2025-07-09T13:30:40.047Z","avatar_url":"https://github.com/blockspacer.png","language":"C++","readme":"﻿\u0026nbsp;\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://CXXCTP.github.io\"\u003e\n    \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Cpp-Francophonie.svg/512px-Cpp-Francophonie.svg.png\" width=\"100px\" alt=\"CXXCTP\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 align=\"center\"\u003eAdd custom features to C++ language, like \u003ca href=\"https://www.fluentcpp.com/2018/03/09/c-metaclasses-proposal-less-5-minutes/\"\u003emetaclasses\u003c/a\u003e, \u003ca href=\"https://twitter.com/TartanLlama/status/1159457033441165313\"\u003eRust-like traits\u003c/a\u003e, reflection and many more\u003c/h3\u003e\n\u003cp align=\"center\"\u003eA fully open source, powerful solution for modification and generation of C++ source code. Reduce the amount of boilerplate code in your C++ projects.\u003c/p\u003e\n\u003chr /\u003e\n\n﻿![Open Source Love](https://img.shields.io/badge/Open%20Source-%E2%9D%A4-pink.svg)\n![First Timers Only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat)\n![Up For Grabs](https://img.shields.io/badge/up--for--grabs-friendly-green.svg?style=flat)\n![GitHub](https://img.shields.io/github/license/blockspacer/CXXCTP.svg)\n![GitHub forks](https://img.shields.io/github/forks/blockspacer/CXXCTP.svg)\n![GitHub issues](https://img.shields.io/github/issues/blockspacer/CXXCTP.svg)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/blockspacer/CXXCTP.svg)\n![GitHub contributors](https://img.shields.io/github/contributors/blockspacer/CXXCTP.svg)\n![GitHub commit activity the past week, 4 weeks, year](https://img.shields.io/github/commit-activity/w/blockspacer/CXXCTP.svg)\n![GitHub last commit](https://img.shields.io/github/last-commit/blockspacer/CXXCTP.svg)\n![GitHub top language](https://img.shields.io/github/languages/top/blockspacer/CXXCTP.svg)\n![GitHub language count](https://img.shields.io/github/languages/count/blockspacer/CXXCTP.svg)\n[![Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)\n[![license](https://img.shields.io/github/license/blockspacer/CXXCTP.svg?style=flat-square)](https://github.com/blockspacer/CXXCTP/master/LICENSE)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/bsamseth/cpp-project.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/blockspacer/CXXCTP/alerts/)\n[![Lines of Code](https://tokei.rs/b1/github/blockspacer/CXXCTP)](https://github.com/blockspacer/CXXCTP)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/blockspacer/CXXCTP.svg)](http://isitmaintained.com/project/blockspacer/CXXCTP \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/blockspacer/CXXCTP.svg)](http://isitmaintained.com/project/blockspacer/CXXCTP \"Percentage of issues still open\")\n\n# NOTE\n\nThis repo will be migrated to https://github.com/blockspacer/flextool as soon as possible\n\nCXXCTP will be deprecated. Prefer flextool\n\n# 🔗 Navigation\n\n - [About CXXCTP](#about)\n - [Usage Examples](#usage)\n - [Cloning and setup](#cloning)\n - [Developing with CXXCTP](#developing)\n - [Tools used by CXXCTP](#tools)\n - [How to contribute](#contribute)\n\n# 📚 \u003ca name=\"about\"\u003e\u003c/a\u003e About CXXCTP (CXX compile-time programming)\n\nCXXCTP is a transpiler that extends C++ for new introspection, reflection and compile-time execution.\n\nCXXCTP doesn't aim to create a predefined set of source code transformations. Users can share C++ scripts for source code transformation.\n\nSuppose someone shared useful scripts like `interface.cxx` and `enum_to_json.cxx` to the open-source community. You can use them in your project just by placing them into the `ctp_scripts` folder.\n\nMetaprogramming is an “art” of writing programs to treat other programs as their data. This means that a program could generate, read, analyse, and transform code or even itself to achieve a certain solution.\n\nNote: This project is provided as it is, without any warranty (see License).\n\n## Features\n\n- C++ as compile-time scripting language (https://github.com/derofim/cling-cmake)\n- Template engine with full C++ power (transpiles template to valid C++ code, supports Cling, etc.). https://github.com/blockspacer/CXTPL\n- Ability to modify source files (implement metaclasses, transpile from C++X to C++Y etc.)\n- Ability to create new files (separate generated class to .hpp and .cpp, etc.)\n- Ability to check source files (implement style checks, design patterns, etc.)\n- Ability to compile scripts (rules for code transformations) for maximum performance, not only interpret them in Cling.\n\n## Motivation\n\nWhy wouldn't you just extend clang since it also provides some experimental features (modules for instance)?\n\nClang is a compiler while this project is a transpiler, that transforms code to standardized c++ code without the need to modify llvm/assembly.\n\nBecause the tool's output is C++ code, you can compile transpiled code using emscripten, use static code analyzers, run code inside cling etc.\n\nCXXCTP allows you to create and share scripts for\n\n- source code check (like codestyle validation)\n- source code transformation (like alphabetical sort of all public functions inside some class)\n- compile-time programming (like retrieve source code modification rules from remote server and save them in some folder) etc.\n\n## Project status\n\nIn development, see examples. Currently supports only Linux.\n\nNote that you can run Linux containers under Windows/Mac/etc.\n\n\n# ⚙️ \u003ca name=\"usage\"\u003e\u003c/a\u003eUsage examples\n- enum_gen_hpp.cxtpl - (codegen) enum to string + reflection metadata.\n\n```cpp\n// usage example from ReflShapeKind.hpp\nenum class\n$apply(\n  reflect_enum\n)\nReflShapeKind0 : uint32_t {\n  Box = 3,\n  Sphere = 6,\n};\n```\n\n- typeclass_gen_cpp.cxtpl - (codegen) typeclasses. Supports combinations of multiple typeclasses and out-of-source method definitions (data and logic separation). Supports combinations of multiple typeclasses and out-of-source method definition (data and logic separation). See examples and https://twitter.com/TartanLlama/status/1159457033441165313\n\n```cpp\n// Usage example. NOTE: no inheritance \u0026 definition outside lib.\n// in lib .h\nstruct drawable {\n  virtual void draw(const char* arg1) const noexcept = 0;\n};\nstruct printable {\n  virtual void print(const char* arg1, const char* arg2) const noexcept = 0;\n};\nstruct canvas3D {\n  std::string name3D;\n};\nstruct canvas4D {\n  std::string name4D;\n};\n// in app .cpp\nvoid draw\u003cdrawable\u003e(const canvas3D\u0026 data, const char* arg1){\n  std::cout \u003c\u003c \"drawing to canvas3D name = \" \u003c\u003c data.name3D \u003c\u003c std::endl;\n}\nvoid draw\u003cdrawable\u003e(const canvas4D\u0026 data, const char* arg1){\n  std::cout \u003c\u003c \"drawing to canvas4D name = \" \u003c\u003c data.name4D \u003c\u003c std::endl;\n}\nvoid print\u003cprintable\u003e(const canvas3D\u0026 data, const char* arg1, const char* arg2){\n  std::cout \u003c\u003c \"printing to canvas3D name = \" \u003c\u003c data.name3D \u003c\u003c std::endl;\n}\nvoid print\u003cprintable\u003e(const canvas4D\u0026 data, const char* arg1, const char* arg2){\n  std::cout \u003c\u003c \"printing to canvas4D name = \" \u003c\u003c data.name4D \u003c\u003c std::endl;\n}\nstd::vector\u003c_tc_combined_t\u003cdrawable\u003e\u003e vec {\n canvas3D{},\n canvas4D{},\n};\n_tc_combined_t\u003cdrawable, printable\u003e CVS = canvas4D{};\nCVS.draw(\"\");\nCVS.print(\"\", \"\");\n\ncanvas3D cvs3D;\nCVS = std::move(cvs3D);\n\ncanvas4D cvs4D;\nCVS = cvs4D; // copy\n\nCVS = vec.at(0); // \u003cdrawable\u003e to \u003cdrawable, printable\u003e\n```\n\n- parse-time/compile-time code execution (see examples)\n\n```cpp\n$export (\nstatic int resultSomeInt = 2345;\n)\n$eval(\"#include \u003coptional\u003e\")\n$exec(\n  printf(\"execkjljlk\\n\");\n  printf(\"execasdasd\\n\");\n)\n$set_embed(\"set_embed103\",\n  printf(\"set_embed101\\n\");\n  printf(\"set_embed102\\n\");\n)\n$embed(\n  [\u0026clangMatchResult, \u0026clangRewriter, \u0026clangDecl]() {\n    printf(\"embed01\\n\");\n    printf(\"embed02\\n\");\n    return new llvm::Optional\u003cstd::string\u003e{\"embed03\"};\n  }();\n)\n```\n\n- metaclasses. Supports combinations of multiple metaclasses (see examples).\n\n```cpp\nclass\n$apply(make_interface;make_removefuncbody;make_reflect)\nSomeInterfaceName {\n  virtual ~SomeInterfaceName() = 0;\n  /*int    f   (   )   {     // {}\n    int i = 6;\n    {\n      // {\n      // }\n    }\n    return i;\n  };*/\n  int foo();\n  virtual void foobar(int\u0026 arg1) = 0;\n  virtual inline void zoobar(int\u0026 arg2);\n  //int m_bar;\n  //int m_bar2 = 2;\n};\n```\n\n# 🖥️ \u003ca name=\"cloning\"\u003e\u003c/a\u003eCloning and setup\n```bash\ngit submodule sync --recursive\ngit fetch --recurse-submodules\ngit submodule update --init --recursive --depth 100 --progress\n# or\ngit submodule update --force --recursive --init --remote\n```\n\n## Install \u0026 use with Docker\n\nInstall and configure Docker: https://medium.com/@saniaky/configure-docker-to-use-a-host-proxy-e88bd988c0aa\n\nClone code (as above) and `cd` into cloned dir.\n\nNOTE: You may want to build Docker image with `--build-arg NO_SSL=\"False\"`. Read comments in Dockerfile.\n\n```bash\n# Give docker the rights to access X-server\nsudo -E xhost +local:docker\n\n# build Dockerfile\nsudo -E docker build --no-cache \\\n  --build-arg GIT_WITH_OPENSSL=\"\" \\\n  --build-arg NO_SSL=\"False\" \\\n  -t cpp-docker-cxxctp .\n\n# Now let’s check if our image has been created.\nsudo -E docker images\n\n# Run in container without leaving host terminal\nsudo -E docker run -v \"$PWD\":/home/u/cxxctp -w /home/u/cxxctp cpp-docker-cxxctp CXXCTP_tool -version --version\n\n# Run a terminal in container\nsudo -E docker run --rm -v \"$PWD\":/home/u/cxxctp -w /home/u/cxxctp  -it  -e DISPLAY         -v /tmp/.X11-unix:/tmp/.X11-unix  cpp-docker-cxxctp\n\n# type in container terminal\nCXXCTP_tool -version --version\n```\n\n## Develop with Docker\n\n```bash\n# Run a terminal in container\nsudo -E docker run --rm -v \"$PWD\":/home/u/cxxctp -w /home/u/cxxctp  -it  -e DISPLAY         -v /tmp/.X11-unix:/tmp/.X11-unix  cpp-docker-cxxctp\n\n# An example of how to build (with Makefile generated from cmake) inside the container\n# Mounts $PWD to /home/u/cxxctp and runs command\nmkdir build\nsudo -E docker run --rm -v \"$PWD\":/home/u/cxxctp -w /home/u/cxxctp/build cpp-docker-cxxctp cmake -DCONAN_AUTO_INSTALL=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE ..\n\n# Run resulting app in host OS:\n# ./build/\u003capp\u003e\n```\n\n## Install conan - a crossplatform dependency manager for C++\n\n```bash\npip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel \\\n  \u0026\u0026 \\\n  pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org virtualenv \\\n  \u0026\u0026 \\\n  pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org conan \\\n  \u0026\u0026 \\\n  pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org conan_package_tools\n\nconan profile new default --detect\n# conan profile update settings.compiler.libcxx=libstdc++11 default\n\nconan remote list\n\nconan search *boost* -r all\n```\n\nConfigure Proxies \u0026 cacert_path in `~/.conan/conan.conf`, see https://docs.conan.io/en/latest/reference/config_files/conan.conf.html#proxies\n\nConfigure conan clang profile to then use --profile clang:\n\n```bash\n/usr/bin/clang-6.0 -v\n/usr/bin/clang++-6.0 -v\n\nnano ~/.conan/profiles/clang\n\n[settings]\n# We are building in Ubuntu Linux\nos_build=Linux\nos=Linux\narch_build=x86_64\narch=x86_64\n\ncompiler=clang\ncompiler.version=6.0\ncompiler.libcxx=libstdc++11\n\n[env]\nCC=/usr/bin/clang-6.0\nCXX=/usr/bin/clang++-6.0\n```\n\nAnd then `conan install ***** --profile clang`\n\n```bash\n/usr/bin/gcc -v\n/usr/bin/g++ -v\n\nnano ~/.conan/profiles/gcc\n\n[settings]\n# We are building in Ubuntu Linux\nos_build=Linux\nos=Linux\narch_build=x86_64\narch=x86_64\n\ncompiler=gcc\ncompiler.version=7\ncompiler.libcxx=libstdc++11\n\n[env]\nCC=/usr/bin/gcc\nCXX=/usr/bin/g++\n```\n\nIf you want to disable ssl (under proxy, etc.):\n\n```bash\n# see https://docs.conan.io/en/latest/reference/commands/misc/remote.html#conan-remote\nconan remote update conan-center https://conan.bintray.com False\nconan search boost* -r=conan-center\n\nconan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan\nconan remote update bincrafters https://api.bintray.com/conan/bincrafters/public-conan False\nconan search boost* -r=bincrafters\n```\n\nIf you want to set corp. cacert:\n\n```bash\nCONAN_CACERT_PATH=/path/to/ca-bundle.crt\nfile $CONAN_CACERT_PATH\n```\n\nUseful links:\n\n- https://ncona.com/2019/04/dependency-management-in-cpp-with-conan/\n- https://blog.conan.io/2018/06/11/Transparent-CMake-Integration.html\n- Conan https://blog.conan.io/2018/06/11/Transparent-CMake-Integration.html https://blog.conan.io/2018/12/03/Using-Facebook-Folly-with-Conan.html\n- CONAN_PKG::cppzmq https://github.com/chaplin89/prontocpp/blob/master/CMakeLists.txt#L42\n- https://github.com/conan-io/examples\n\n## Add conan remotes\n\nTo be able to add the list of dependency remotes please type the following command:\n\n```bash\ncmake -E time conan config install conan/remotes/\n# OR:\n# cmake -E time conan config install conan/remotes_disabled_ssl/\n```\n\n## Dependencies\n\n```bash\n# NOTE: don't forget to re-run `conan install` after command below\n# NOTE: change `build_type=Debug` to `build_type=Release` in production\ncmake -DEXTRA_CONAN_OPTS=\"--profile;clang;-s;build_type=Debug;--build;missing\" -P tools/buildConanThirdparty.cmake\n```\n\n- type_safe\n\n```bash\nconan remote add Manu343726 https://api.bintray.com/conan/manu343726/conan-packages False\n\ngit clone http://github.com/foonathan/type_safe.git -b v0.2.1\n\ncd type_safe\n\n# NOTE: change `build_type=Debug` to `build_type=Release` in production\nCONAN_REVISIONS_ENABLED=1 \\\n    CONAN_VERBOSE_TRACEBACK=1 \\\n    CONAN_PRINT_RUN_COMMANDS=1 \\\n    CONAN_LOGGING_LEVEL=10 \\\n    GIT_SSL_NO_VERIFY=true \\\n    conan create . conan/stable -s build_type=Debug --profile clang --build missing\n```\n\n- corrade\n\n```bash\n# NOTE: change `build_type=Debug` to `build_type=Release` in production\ngit clone http://github.com/mosra/corrade.git \u0026\u0026 cd corrade\nCONAN_REVISIONS_ENABLED=1 \\\n    CONAN_VERBOSE_TRACEBACK=1 \\\n    CONAN_PRINT_RUN_COMMANDS=1 \\\n    CONAN_LOGGING_LEVEL=10 \\\n    GIT_SSL_NO_VERIFY=true \\\n    conan create . magnum/stable -s build_type=Debug --profile clang --build missing -tf package/conan/test_package\n```\n\n- MPI\n\n```bash\nsudo apt-get install openmpi-bin openmpi-common libopenmpi-dev\n```\n\n- CMake\n\n```bash\nsudo -E apt-get purge -y cmake\nbash scripts/install_cmake.sh\n```\n\nInstall CXTPL library https://github.com/blockspacer/CXTPL\n\nInstall CXTPL_tool https://github.com/blockspacer/CXTPL#how-to-build\n\n## How to build\n\n```bash\nBEFORE install_cling.sh:\nsudo apt-get update \u0026\u0026 sudo apt-get upgrade\nsudo apt-get install clang-6.0 libstdc++6 libstdc++-6-dev\nsudo update-alternatives --config c++\nsudo update-alternatives --config cc\nsudo ldconfig\nexport CC=clang-6.0\nexport CXX=clang++-6.0\n```\n\n```bash\n# Build Cling into `cling-build` folder\ncd scripts\nbash install_cling.sh\n```\n\nInstall deps as in CXTPL https://github.com/blockspacer/CXTPL#how-to-build\n\n```bash\nexport CC=clang-6.0\nexport CXX=clang++-6.0\ncmake -E remove_directory build\ncmake -E make_directory build\ncmake -E remove_directory resources/cxtpl/generated\ncmake -E make_directory resources/cxtpl/generated\n# NOTE: change `build_type=Debug` to `build_type=Release` in production\nCONAN_REVISIONS_ENABLED=1 \\\n  CONAN_VERBOSE_TRACEBACK=1 \\\n  CONAN_PRINT_RUN_COMMANDS=1 \\\n  CONAN_LOGGING_LEVEL=10 \\\n  GIT_SSL_NO_VERIFY=true \\\n  cmake -E chdir build  \\\n    cmake -E time \\\n      conan install \\\n        -s build_type=Debug \\\n        --build=missing \\\n        --profile clang \\\n        -o enable_tests=False \\\n        -o openssl:shared=True \\\n        ..\ncmake -E chdir build cmake -E time cmake -DCONAN_AUTO_INSTALL=OFF -DENABLE_CLING=TRUE -DBUILD_SHARED_LIBS=FALSE -DBUILD_EXAMPLES=FALSE -DALLOW_PER_PROJECT_CTP_SCRIPTS=TRUE  -DBUNDLE_EXAMPLE_SCRIPTS=FALSE -DCMAKE_BUILD_TYPE=Debug -DENABLE_CXXCTP=TRUE ..\ncmake -E chdir build cmake -E time cmake --build . -- -j6\n\n# you can install CXXCTP_tool:\nsudo cmake -E chdir build make install\n\n# NOTE: You can also use the “-p” flag with CMAKE_EXPORT_COMPILE_COMMANDS. See https://variousburglarious.com/2018/02/18/include-paths-for-clang-tools/\n# cmake -E chdir build ./tool/CXXCTP_tool -p=../example_compile_commands/\n\n# NOTE: runs CXXCTP_tool on multiple files and adds include paths by `-extra-arg=-I`\ncmake -E chdir build ./tool/CXXCTP_tool -L .=DBG9 -extra-arg=-I$PWD/include -extra-arg=-I../resources ../examples/built_in/for_codegen/example_make_reflect.cpp\n\n# check generator output\nfile build/example_make_reflect.cpp.generated.cpp\n```\n\nOR under gdb:\n\n```bash\nrm -rf *generated* ; clear \u0026\u0026 clear ; gdb ./CXXCTP -ex \"run\" -ex \"bt\" -ex \"q\"\n```\n\n## How to build with Cling support\n\nUse shared CXXCTP_core as SHARED library `-DBUILD_SHARED_LIBS=TRUE`.\n\nRun bash scripts/install_folly.sh from https://github.com/blockspacer/CXTPL or patch folly manually for clang support (replace FOLLY_USE_JEMALLOC with FOLLY_ASSUME_NO_JEMALLOC) https://github.com/facebook/folly/issues/976\n\nUse clang (NOT GCC!) before build and `-DENABLE_CLING=TRUE`:\n\n```bash\nexport CC=clang-6.0\nexport CXX=clang++-6.0\nsudo rm -rf examples/*/ctp_scripts/*/*/generated/\ncmake -E remove_directory build\ncmake -E make_directory build\ncmake -E remove_directory resources/cxtpl/generated\ncmake -E make_directory resources/cxtpl/generated\n# NOTE: clang profile!\n# NOTE: change `build_type=Debug` to `build_type=Release` in production\nCONAN_REVISIONS_ENABLED=1 \\\n  CONAN_VERBOSE_TRACEBACK=1 \\\n  CONAN_PRINT_RUN_COMMANDS=1 \\\n  CONAN_LOGGING_LEVEL=10 \\\n  GIT_SSL_NO_VERIFY=true \\\n  cmake -E chdir build  \\\n    cmake -E time \\\n      conan install \\\n        -s build_type=Debug \\\n        --build=missing \\\n        --profile clang \\\n        -o enable_tests=False \\\n        -o openssl:shared=True \\\n        ..\ncmake -E chdir build cmake -E time cmake -DCONAN_AUTO_INSTALL=OFF -DENABLE_CLING=TRUE -DBUILD_SHARED_LIBS=TRUE -DALLOW_PER_PROJECT_CTP_SCRIPTS=TRUE -DBUILD_EXAMPLES=FALSE -DBUNDLE_EXAMPLE_SCRIPTS=FALSE -DCLEAN_CXXCTP_GEN=TRUE -DCMAKE_BUILD_TYPE=Debug -DENABLE_CXXCTP=TRUE ..\n# OR cmake -E chdir build cmake -E time cmake -DCONAN_AUTO_INSTALL=OFF -DENABLE_CLING=TRUE -DBUILD_SHARED_LIBS=TRUE -DALLOW_PER_PROJECT_CTP_SCRIPTS=FALSE -DBUILD_EXAMPLES=FALSE -DBUNDLE_EXAMPLE_SCRIPTS=TRUE -DCLEAN_CXXCTP_GEN=TRUE -DCMAKE_BUILD_TYPE=Debug -DENABLE_CXXCTP=TRUE ..\ncmake -E chdir build cmake -E time cmake --build . -- -j6\n# you can install CXXCTP_tool:\nsudo cmake -E chdir build make install\n# check supported plugins\n/usr/local/bin/CXXCTP_tool --plugins\n```\n\nIf you installed CXXCTP_tool - you can run examples:\n\n```bash\n# requires CXXCTP_tool\nsudo cmake -E chdir build make install\n\n# use -DBUILD_EXAMPLES=TRUE\nrm ./build/examples/simple/CXXCTP_tool_for_CXXCTP_example.log\ncmake -E chdir build cmake -E time cmake -DCONAN_AUTO_INSTALL=OFF -DENABLE_CLING=TRUE -DBUILD_SHARED_LIBS=TRUE -DBUILD_EXAMPLES=TRUE -DBUNDLE_EXAMPLE_SCRIPTS=FALSE -DALLOW_PER_PROJECT_CTP_SCRIPTS=TRUE -DCMAKE_BUILD_TYPE=Debug -DENABLE_CXXCTP=TRUE ..\ncmake -E chdir build cmake -E time cmake --build . -- -j6\ncat ./build/examples/simple/CXXCTP_tool_for_CXXCTP_example.log\n\nCheck that `.log` find doesn`t contain errors\n\n# run examples\nbuild/bin/CXXCTP_example\n```\n\nDon't forget to set Cling include paths by`-extra-arg=-I\\$PWD/include`and library paths by`-extra-arg=-L\\$PWD/build`and .so/.dll libs by`-extra-arg=-lCXXCTP_core`:\n\n```bash\n# NOTE: runs CXXCTP_tool on multiple files and adds include paths by `-extra-arg=-I`\ncmake -E chdir build ./tool/CXXCTP_tool --ctp_scripts_paths=$PWD -L .=DBG9 -extra-arg=-I$PWD/include -extra-arg=-L$PWD/build -extra-arg=-lCXXCTP_core -extra-arg=-I../resources ../resources/ReflShapeKind.hpp ../resources/test_typeclass_base1.hpp ../resources/test_typeclass_instance1.hpp ../resources/test.cpp\n```\n\n## How to add include paths or definitions for Cling\n\nUse `-extra-arg` option of `CXXCTP_tool`:\n\n```bash\n-extra-arg=-I$PWD/include -extra-arg=-I$PWD/include/foo -extra-arg=-DMY_DEFINITION=1 -extra-arg=-DONE_MORE_DEFINITION=1\n```\n\nExample:\n\n```bash\ncmake -E chdir build ./tool/CXXCTP_tool --ctp_scripts_paths=$PWD -L .=DBG9 -extra-arg=-I$PWD/include -extra-arg=-I../resources ../resources/ReflShapeKind.hpp ../resources/test_typeclass_base1.hpp ../resources/test_typeclass_instance1.hpp ../resources/test.cpp\n```\n\n# ⌨️ \u003ca name=\"developing\"\u003e\u003c/a\u003eDeveloping with CXXCTP\nThe following sections cover usage, custom rules and debugging for CXXCTP.\n## Writing code that writes code\n\nYou can write custom C++ scripts for source code transformation or use existing ones.\n\nCXXCTP loads all C++ scripts from ctp_scripts folder in lexicographical order.\n\nExample contents of ctp_scripts:\n\n- 1_utils\n  - CXTPL_STD\n    - CXTPL_STD.hpp\n    - CXTPL_STD.cpp\n  - CXXCTP_STD\n    - CXXCTP_STD.hpp\n    - CXXCTP_STD.cpp\n- 2_scripts\n  - make_interface\n    - make_interface.hpp\n    - make_interface.cpp\n  - typeclass\n    - typeclass.hpp\n    - typeclass.cpp\n\nUtils must load before scripts (Cling related), so we added `1_`, `2_`, ... before folder names (see above).\n\nYou can use `#include`, use filesystem, access the internet, etc. in C++ scripts.\n\n## Got error `libcling.so.5: cannot open shared object file: No such file or\ndirectory`\n\nInstall with `-DENABLE_CLING=TRUE -DINSTALL_CLING=TRUE` and set `LD_LIBRARY_PATH`\n\n```bash\nexport LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH\nsudo ldconfig\n```\n\n## About CXXCTP code annotations\n\nYou can use C++ annotations to tell CXXCTP what actions it must execute.\n\nSuppose we want to morph class into interface:\n\n```cpp\n// Source\nclass SomeInterfaceName {\n  int foo1() {\n    // ...\n  };\n  int foo();\n  virtual void foobar(int\u0026 arg1) = 0;\n  virtual void zoobar(int\u0026 arg2);\n  virtual ~SomeInterfaceName() = 0;\n};\n\n// \u003c== will be changed into ==\u003e\n\n// Result\nclass SomeInterfaceName {\n  virtual int foo1() = 0;\n  virtual int foo() = 0;\n  virtual void foobar(int\u0026 arg1) = 0;\n  virtual void zoobar(int\u0026 arg2) = 0;\n  virtual ~SomeInterfaceName() = 0;\n};\n```\n\nWe can use `funccall` action to run C++ scripts for source code transformation. Let's suppose that script names are `make_interface` and `make_removefuncbody` (name as you want).\n\n```cpp\n__attribute__((annotate(\"{gen};{funccall};make_interface;make_removefuncbody\")))\n```\n\n`{gen};` - keyword used in every CXXCTP annotation.\n\n`{funccall};` - keyword used to tell CXXCTP what it must execute C++ scripts with cling.\n\n`make_interface;make_removefuncbody` - two scripts what CXXCTP will execute.\n\nScripts will be executed from left (`make_interface`) to right (`make_removefuncbody`).\n\nUsually you don't need to write long C++ annotations, just use C++ `#define` (or include built-in header with common defines):\n\n```cpp\n#define $apply(...) \\\n  __attribute__((annotate(\"{gen};{funccall};\" #__VA_ARGS__)))\n\nclass\n$apply(make_interface;\n  make_removefuncbody)\nSomeInterfaceName {\n  virtual ~SomeInterfaceName() = 0;\n  int foo();\n  virtual void foobar(int\u0026 arg1) = 0;\n  virtual void zoobar(int\u0026 arg2);\n};\n```\n\nUsing a similar approach you can apply multiple source code transformation steps to the same `class` / `struct` / etc.\n\n## How to add custom code transformation rules\n\nCreate files with your function in `ctp_scripts`\n\nCopy `custom_plugins.cmake.example` as `custom_plugins.cmake`\n\nAppend your script paths to `custom_plugins.cmake` via `add_ctp_plugin`:\n\n```bash\n# first arg - typeclass_instance - script function name\n# second arg - script source file\n# third arg - script header file\n# last arg - path to CMakeLists.txt used to generate script-related files\nadd_ctp_plugin(\n  \"typeclass_instance\"\n  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple/ctp_scripts/2_scripts/typeclass_instance/typeclass_instance.cpp\n  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple/ctp_scripts/2_scripts/typeclass_instance/typeclass_instance.hpp\n  ${CMAKE_CURRENT_SOURCE_DIR}/examples/simple/ctp_scripts/2_scripts/typeclass_instance\n)\n```\n\nCheck that your function name exists in generated file `ctp_registry.cpp` (may be skipped in Cling / dev-mode)\n\nFunction signature for code transformation must be compatible with `cxxctp_callback`:\n\n```cpp\ntypedef std::function\u003cconst char*(\n    const cxxctp::parsed_func\u0026 func_with_args,\n    const clang::ast_matchers::MatchFinder::MatchResult\u0026 matchResult,\n    clang::Rewriter\u0026 rewriter,\n    const clang::Decl* decl,\n    const std::vector\u003ccxxctp::parsed_func\u003e\u0026 all_funcs_with_args)\u003e cxxctp_callback;\n```\n\nDetailed function signature:\n\n- return value (const char\\*) - used to replace original code, if needed.\n- func_with_args - currently executed function from list `all_funcs_with_args` (see below)\n- clang::ast_matchers::MatchFinder::MatchResult - see https://xinhuang.github.io/posts/2015-02-08-clang-tutorial-the-ast-matcher.html\n- clang::Rewriter - see https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-part-3-rewriting-code-with-clang-tidy/\n- clang::Decl - found by MatchFinder, see https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-part-2-examining-the-clang-ast-with-clang-query/\n- std::vector\u003cparsed_func\u003e - all arguments extracted from attribute. Example: \\$apply(interface, foo_with_args(1, \"2\")) becomes two `parsed_func` - `interface` and `foo_with_args`.\n\nThink about function name as one of `__VA_ARGS__` from\n\n```cpp\n#define $apply(...) \\\n  __attribute__((annotate(\"{gen};{funccall};\" #__VA_ARGS__)))\n```\n\nExample where `make_interface` and `make_removefuncbody` - two function names:\n\n```cpp\n$apply(make_interface;\n  make_removefuncbody)\n```\n\nIf you need code generation:\n\n- Create template file (`.cxtpl`). Build your file using CXTPL_tool https://github.com/blockspacer/CXTPL\n- Create all needed template arguments inside of your function. Names, types, etc. for arguments must be the same as in template (cause generated template is valid C++ code).\n- Create variable `std::string cxtpl_output`, that will store result of template rendering with some arguments.\n- Include file generation from template file (`.cxtpl`) inside of your function.\n\n## What is `.cxtpl`\n\n`.cxtpl` is the file extension for the C++ template engine https://github.com/blockspacer/CXTPL\n\n## How to add `.cxtpl` at compile-time (CMake)\n\nAdd your `.cxtpl` file into `Codegen_files.cmake`\n\nNOTE:\nIn dev mode (like cling mode) it may be a good idea to generate files from templates using CXTPL_tool https://github.com/blockspacer/CXTPL\nYou can add generation rules into `Codegen_files.cmake` later in the release build.\n\nNOTE:\nDon't forget to provide both `.cxtpl`and`.cxtpl.h` files with shared codegen rules (add to version control system).\n\n## How to use `.cxtpl` at runtime with Cling\n\nYou have two options:\n\n- Generate a file from your `.cxtpl`, then include it into Cling C++ script. Similar to compile-time, but you can re-generate or change files without program recompilation. Note that it is possible to generate files and include them in your script; just split script into multiple includes.\n- Generate a string from your `.cxtpl`, then run it in a separate Cling interpreter. In most cases you will use the first option.\n\n## How to use `.cxtpl` with CXXCTP\n\nPass reflection data into template engine.\n\nGenerate files from templates using CXTPL_tool https://github.com/blockspacer/CXTPL\n\nIn CXXCTP script (`.cpp`):\n\n```cpp\n// see ReflectAST.cpp\nreflection::NamespacesTree m_namespaces;\n// `node` from AST parser (libtooling)\nreflection::ClassInfoPtr structInfo = reflector.ReflectClass(node, \u0026m_namespaces);\n\n// ...\n\nstuct Arguments {\n  // any custom arguments here ...\n  std::string arg1 = \"arg1...\";\n  std::string arg2 = \"arg2...\";\n  // reflection data here (ClassInfoPtr) ...\n};\n\n// ...\n\nstd::map\u003cstd::string, std::any\u003e cxtpl_params;\n{\n    cxtpl_params[\"Arguments\"] =\n        std::make_any\u003cArguments\u003e(Arguments{});\n    cxtpl_params[\"generator_path\"] =\n        std::make_any\u003cstd::string\u003e(\"enum_gen_hpp.cxtpl\");\n    cxtpl_params[\"generator_includes\"] =\n        std::make_any\u003cstd::vector\u003cstd::string\u003e\u003e(\n            std::vector\u003cstd::string\u003e{});\n\n    std::string cxtpl_output;\n\n#include \"../../resources/cxtpl/generated/enum_gen_hpp.cxtpl.cpp\"\n\n    writeToFile(cxtpl_output, gen_hpp_name);\n}\n```\n\nIn `.cxtpl` template:\n\n```cpp\nconst auto arguments = std::any_cast\u003cArguments\u003e(cxtpl_params.at(\"Arguments\"));\nstd::cout \u003c\u003c arguments.arg1;\n```\n\nSee `resources/cxtpl/enum_gen_hpp.cxtpl` as an example.\n\n## How to use CXXCTP_tool\n\nCXXCTP_tool wraps libtooling to add custom command-line options.\n\nOptions related to libtooling (type -help or --help):\n\n```bash\nGeneric Options:\n\n  -help                      - Display available options (-help-hidden for more)\n  -help-list                 - Display list of available options (-help-list-hidden for more)\n  -version                   - Display the version of this program\n\nUse override options:\n\n  -extra-arg=\u003cstring\u003e        - Additional argument to append to the compiler command line\n  -extra-arg-before=\u003cstring\u003e - Additional argument to prepend to the compiler command line\n  -p=\u003cstring\u003e                - Build path\n```\n\nOptions related to CXXCTP_tool (type --help, not -help):\n\n`ctp_scripts_paths` - list of paths where toll will search for ctp_scripts subfolder\n\nNOTE: `ctp_scripts_paths` requires `-DENABLE_CLING=TRUE`\n\n`-L .=DBG9` is log configuration in format https://github.com/facebook/folly/blob/master/folly/logging/docs/Config.md\n\nExample of log configuration that writes both into the file and console stream:\n\n```bash\n./build/bin/CXXCTP_tool -L \".:=INFO:default:console; default=file:path=y.log,async=true,sync_level=DBG9;console=stream:stream=stderr\"\n```\n\n`--srcdir` to change current filesystem path for input files.\n\n`--resdir` to change current filesystem path for output files.\n\nExample (custom output dir):\n\n```bash\n# Remove old generated files\nrm -rf gen\nrm -rf build/*generated*\n\n`--version` to get tool version\n\n`-version` to get clang version\n\n# Build files to `gen/out` dir\nmkdir -p gen/out\ncmake -E chdir gen ../build/bin/CXXCTP_tool --resdir=$PWD/gen/out --ctp_scripts_paths=$PWD -L .=DBG9 -extra-arg=-I$PWD/include -extra-arg=-I../resources ../resources/ReflShapeKind.hpp ../resources/test_typeclass_base1.hpp ../resources/test_typeclass_instance1.hpp ../resources/test.cpp\n```\n\n## How to debug `ctp_scripts`\n\nRemove old build artifacts and generated files.\n\nBundle your scripts with `CXXCTP_tool` via `-DBUNDLE_EXAMPLE_SCRIPTS=TRUE`.\n\nMake sure that your scripts (plugins) are added to `CXXCTP_tool` via `custom_plugins.cmake.example`.\n\nDisable per-project scripts `-DALLOW_PER_PROJECT_CTP_SCRIPTS=FALSE`.\n\nCheck that your scripts (plugins) are in `build/tool/CXXCTP_tool --plugins`\n\nCheck that the system-installed version of `CXXCTP_tool` is the same as `build/tool/CXXCTP_tool` (by date/file hash)\n\nRun `CXXCTP_tool` manually under `gdb`:\n\n```bash\ngdb -ex \"r\" -ex \"bt\" --args build/tool/CXXCTP_tool .........\n```\n\nCheck that all needed paths are in `-extra-arg=`.\n\nMake a log to file in `DBG9` mode and check `.log` files.\n\n# 🔧 \u003ca name=\"tools\"\u003e\u003c/a\u003eTools used by CXXCTP\n\n## About libtooling\n\nCXXCTP uses LibTooling to parse and modify C++.\n\nLibTooling is a library to support writing standalone tools based on Clang.\n\nUseful links:\n\n- https://clang.llvm.org/extra/clang-rename.html\n- Clang Tooling I (add override keyword) https://medium.com/@chichunchen844/clang-tooling-i-add-override-keyword-ddfdf6113b24\n- llvm-clang-samples https://github.com/eliben/llvm-clang-samples/blob/master/src_clang/tooling_sample.cpp\n- https://chromium.googlesource.com/chromium/src/+/master/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp\n- http://www.dreamlandcoder.com/system-security/how-i-learned/clang-libtool/\n- https://jonasdevlieghere.com/understanding-the-clang-ast/\n- http://swtv.kaist.ac.kr/courses/cs453-fall13/Clang%20tutorial%20v4.pdf\n- https://meetingcpp.com/mcpp/slides/2019/Teaching%20Old%20Compilers%20New%20Tricks_%20Transpiling%20C++17%20to%20C++11.pdf\n- https://gist.github.com/riyadparvez/a2c157b24579c6552466\n- https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-part-3-rewriting-code-with-clang-tidy/\n- http://blog.audio-tk.com/2018/03/20/writing-custom-checks-for-clang-tidy/\n- https://meetingcpp.com/mcpp/slides/2018/Reflection2.pdf\n- https://s3.amazonaws.com/connect.linaro.org/yvr18/presentations/yvr18-223.pdf\n- https://kevinaboos.wordpress.com/2013/07/30/clang-tips-and-tricks/\n- https://eli.thegreenplace.net/tag/llvm-clang\n- http://www.goldsborough.me/c++/clang/llvm/tools/2017/02/24/00-00-06-emitting_diagnostics_and_fixithints_in_clang_tools/\n- https://www.amazon.com/Getting-Started-LLVM-Core-Libraries/dp/1782166920\n- https://variousburglarious.com/tag/clang/\n\n## About cling\n\nCXXCTP uses cling to execute C++ at compile-time.\n\nYou can use cling for hot code reload / REPL / Fast C++ prototyping / Scripting engine / JIT / etc.\n\nUseful links:\n\n- (how to add Cling into CMake project) https://github.com/derofim/cling-cmake\n- https://github.com/root-project/cling/tree/master/www/docs/talks\n- https://github.com/caiorss/C-Cpp-Notes/blob/master/Root-cern-repl.org\n\n### clang-format\n\n```bash\nsudo apt install clang-format\n```\n\nRun based on `.clang-format` file:\n\n```bash\nfind . -regex '.*\\.\\(cpp\\|hpp\\|cu\\|c\\|h\\)' -exec clang-format -style=file -i {} \\;\n```\n\nUseful links:\n\n- Create \u0026 use `.clang-format` file https://leimao.github.io/blog/Clang-Format-Quick-Tutorial/\n- Integrate with your IDE ( QT instructions http://doc.qt.io/qtcreator/creator-beautifier.html ) Import .clang-format rules to IDE settings.\n\n# ⭐️ \u003ca name=\"contribute\"\u003e\u003c/a\u003eHow to Contribute\n\nPlease read our [contributing](CONTRIBUTING.md) guidelines before making your pull request.\n\n## Code of Conduct\n\nPlease note that this project is released with a [Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.\n\n### Contributors List: Example Profile\n\n- I'm an example that you can copy, if you want :)\n- I work on many things like...\n- My hobbies include...\n- [![twitter-alt][twitter-img]](https://twitter.com/example)\n  [![facebook-alt][facebook-img]](https://facebook.com/example)\n  [![google-img][google-img]](https://plus.google.com/+Example)\n  [![tumblr-alt][tumblr-img]](https://example.tumblr.com)\n  [![dribbble-alt][dribbble-img]](https://dribbble.com/example)\n  [![github-alt][github-img]](https://github.com/example)\n  [![freeCodeCamp](imgs/freecodecamp.png)](https://www.freecodecamp.org/example)\n  [\u003cimg src=\"imgs/linkedin.svg\" width=\"20\" height=\"20\"\u003e](https://www.linkedin.com/in/example/)\n\n### Contributors List 👌\n\n#### A\n\n##### Anindita Basu\n\n- Technical writer\n- [![twitter-alt][twitter-img]](https://twitter.com/anindita_basu)\n  [![github-alt][github-img]](https://github.com/AninditaBasu)\n\n##### Anna Hayhurst\n\n- Junior Developer\n- [![github-alt][github-img]](https://github.com/annahayhurst)\n\n#### C\n\n##### Cássio Espíndola\n\n- Analyst Developer\n- [![github-alt][github-img]](https://github.com/cassioesp)\n\n#### D\n\n##### Denis trofimov\n\n- C++ Developer\n- [![github-alt][github-img]](https://github.com/blockspacer)\n- [![github-alt][github-img]](https://github.com/derofim)\n- [\u003cimg src=\"imgs/linkedin.svg\" width=\"20\" height=\"20\"\u003e](https://www.linkedin.com/in/denis-trofimov-4335bb13b/)\n\n#### M\n\n##### Mohib Qureshi\n\n- Software Development Enthusiast\n- [![github-alt][github-img]](https://github.com/mohibqureshi)\n\n#### Y\n\n##### Yousif Alebyary\n\n- Web/Mobile Developer.\n- [![github-alt][github-img]](https://github.com/yousifm)\n\n##### Yves Mancera\n\n- Software Engineer\n- [![github-alt][github-img]](https://github.com/yvesmh)\n\n## Standing on the Shoulders of Giants\n\nThat project possible because of [flexferrum's `autoprogrammer`](https://github.com/flexferrum/autoprogrammer).\n\nArticles about flexferrum's `autoprogrammer` in media:\n\n- [RUS] метаклассах по-русски https://habr.com/ru/article/448466/\n- [RUS] Метаклассы в C++17 Фантастика? Реальность! https://assets.ctfassets.net/oxjq45e8ilak/55bGdX2PnYzmrpM8rwCjcE/791e7eee3236c2023e86e169faca8a0e/Sergei_Sadovnikov_Metaclasses_in_C___dream_Reality.pdf\n\n## LICENSE for open source components\n\nAll the open source components are used under their associated open source licences.\n\nUsed open source components:\n* icu\n* ced\n* boost\n* harfbuzz\n* boost.outcome\n* chromium (base)\n* libevent\n* modp_b64\n* tcmalloc\n* xdg_mime\n* xdg_user_dirs\n* dynamic_annotations\n* (Facebook) Folly\n* (Microsoft) GSL\n\nSee LICENSE files\n\n### CMake Code style\n\nCMake files pass style checks, can be fixed by running run-cmake-format.py from the root of the repository. This requires Python 3 and [cmake_format](https://github.com/cheshirekow/cmake_format) (note: this currently does not work on Windows)\n\nUse autoformatter `cmake-format.py` and `run-cmake-format.py`\n\n```bash\npip3 install cmake_format\npython3 run-cmake-format.py\n```\n\nTo use cmake-format on a specific CMakeLists.txt file in the command line run\n\n```bash\npython3 -m cmake_format -c cmake-format.py -i CMakeLists.txt\n```\n\nThere is an official Visual Studio extension, details of which can be found [here](https://marketplace.visualstudio.com/items?itemName=cheshirekow.cmake-format).\n\nFollow CMake StyleGuide https://github.com/ruslo/0\n\n## Projects that use `.cxtpl`\n\n- [SKG](https://github.com/blockspacer/skia-opengl-emscripten) C++ HTML/CSS UI.\n\n# 📋 Similar projects\n\n- https://github.com/cppreflect/metapp\n- https://github.com/flexferrum/autoprogrammer/blob/8c9867d357450b99202dac81730851ffc8faa891/src/generators/pimpl_generator.cpp\n- Clava https://github.com/specs-feup/clava\n- Compile-time EXecution of C++ code https://github.com/MaliusArth/cex/blob/6f6e700a253b06c7ae6801e1a3c1f3d842931d77/tool/src/MatchCallbacks/AnnotatedFunctionCallback.cpp\n- circle https://github.com/seanbaxter/circle/blob/master/examples/README.md\n- SugarCpp https://github.com/curimit/SugarCpp\n- ExtendedCpp https://github.com/reneeichhorn/extended-cpp\n- https://github.com/dobkeratops/compiler\n- transpiling_cpp17_to_cpp11 https://github.com/neobrain/cftf\n- https://github.com/llvm-mirror/clang-tools-extra/blob/388528d/clang-tidy/add_new_check.py\n- https://github.com/aantron/better-enums\n- https://github.com/Neargye/magic_enum\n- https://github.com/foonathan/standardese\n- https://github.com/Leandros/metareflect/blob/0208fdd4fc0ea1081ae2ff4c3bfce161305a7423/README.md#run-the-metareflect-tool\n- https://github.com/qtinuum/QtnProperty#overview\n- https://github.com/p-ranav/pprint\n- https://github.com/google/draco/blob/master/CMakeLists.txt#L715\n- https://github.com/goto40/rpp/blob/ec8a4c4a3ac32dccee8c4e8ba97be8c2ba1c8f88/src/parser/common_parser.cpp#L21\n- More https://gist.github.com/blockspacer/6f03933de4f9a6c920649713b056ba4a\n\n[twitter-alt]: Twitter\n[facebook-alt]: Facebook\n[google-alt]: Google+\n[tumblr-alt]: Tumblr\n[dribbble-alt]: Dribbble\n[github-alt]: GitHub\n[twitter-img]: https://i.imgur.com/wWzX9uB.png\n[facebook-img]: https://i.imgur.com/fep1WsG.png\n[google-img]: https://i.imgur.com/VlgBKQ9.png\n[tumblr-img]: https://i.imgur.com/jDRp47c.png\n[dribbble-img]: https://i.imgur.com/Vvy3Kru.png\n[github-img]: https://i.imgur.com/9I6NRUm.png\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockspacer%2FCXXCTP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockspacer%2FCXXCTP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockspacer%2FCXXCTP/lists"}