โ† All CPP Flashcard Decks

Build Systems & Package Management Flashcards

7 cards from real CPP practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Build Systems & Package Management flashcards as text
  1. Which file does vcpkg use in manifest mode to declare a project's dependencies?

    Answer: vcpkg.json

    In vcpkg manifest mode, `vcpkg.json` in the project root lists all required packages and version constraints.

  2. What is a CMake `INTERFACE` library primarily used for?

    Answer: Propagating usage requirements (includes, defines) to consumers without compiling any sources

    An INTERFACE library has no compiled output but can carry properties like include paths and compile options that propagate to linking targets.

  3. In Ninja build system, what command displays a list of all available build targets?

    Answer: ninja -t targets

    `ninja -t targets` (using the targets tool) prints all targets defined in the build.ninja file.

  4. What does `cmake --build . --target install` do after a successful configure step?

    Answer: Builds the project and then runs the install rules to copy files to CMAKE_INSTALL_PREFIX

    The `install` target compiles the project (if needed) and then copies artifacts to the directory specified by `CMAKE_INSTALL_PREFIX`.

  5. Which Conan command generates a `conanfile.txt` dependency graph visualization?

    Answer: conan graph info

    `conan graph info` displays the dependency graph including all transitive dependencies and their resolved versions.

  6. In CMake, `CMAKE_BUILD_TYPE` is only meaningful for which type of generator?

    Answer: Single-configuration generators like Unix Makefiles and Ninja

    Single-configuration generators (Makefile, Ninja) rely on `CMAKE_BUILD_TYPE` at configure time; multi-config generators select the build type at build time.

  7. What is the role of `pkg-config` in a C++ build workflow on Linux?

    Answer: It provides compile and link flags for installed libraries via `.pc` files

    `pkg-config` reads `.pc` metadata files installed with libraries and outputs the correct `-I` and `-l` flags for the compiler.

Build Systems & Package Management Flashcards โ€” CPP Study Cards with Answers