Reader small image

You're reading from  Clang Compiler Frontend

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837630981
Edition1st Edition
Right arrow
Author (1)
Ivan Murashko
Ivan Murashko
author image
Ivan Murashko

Ivan V. Murashko is a C++ software engineer: He got his PhD from Peter the Great St.Petersburg Polytechnic University and has over 20 years of C++ programming experience; since 2020 he has worked with LLVM compilers. His area of interest includes clang compiler frontend and clang tools (clang-tidy, clangd).
Read more about Ivan Murashko

Right arrow

1.3 Source code compilation

We are compiling our source code in debug mode to make it suitable for future investigations with a debugger. We are using LLDB as the debugger. We will start with an overview of the build process and finish building the LLDB as a concrete example.

1.3.1 Configuration with CMake

Create a build folder where the compiler and related tools will be built:

$ mkdir build
$ cd build

The minimal configuration command looks like this:

$ cmake -DCMAKE_BUILD_TYPE=Debug ../llvm

The command requires the build type to be specified (e.g. Debug in our case) as well as the primary argument that points to a folder with the build configuration file. The configuration file is stored as CMakeLists.txt and is located in the llvm folder, which explains the ../llvm argument usage. The command generates Makefile located in the build folder, thus you can use the simple make command to start the build process.

We will use more advanced configuration...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Clang Compiler Frontend
Published in: Mar 2024Publisher: PacktISBN-13: 9781837630981

Author (1)

author image
Ivan Murashko

Ivan V. Murashko is a C++ software engineer: He got his PhD from Peter the Great St.Petersburg Polytechnic University and has over 20 years of C++ programming experience; since 2020 he has worked with LLVM compilers. His area of interest includes clang compiler frontend and clang tools (clang-tidy, clangd).
Read more about Ivan Murashko