Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 3 KB

File metadata and controls

90 lines (70 loc) · 3 KB

CMake Build System Setup Summary

Task Completed: setup-cmake-bootstrap

What Was Accomplished

  1. Modern CMake Infrastructure (CMake 3.20+)

    • Root CMakeLists.txt with proper project configuration
    • C++20 standard enforced
    • Export compile commands for IDE integration
    • Proper build type handling
  2. Dependency Management

    • FetchContent used for all dependencies:
      • fmt 10.2.1 (string formatting)
      • spdlog 1.13.0 (logging)
      • CLI11 2.4.1 (command-line parsing)
      • nlohmann_json 3.11.3 (JSON parsing)
      • GoogleTest 1.14.0 (testing framework)
    • Option to use system dependencies (FINCH_USE_SYSTEM_DEPS)
  3. CMake Helper Modules (in cmake/ directory)

    • CompilerWarnings.cmake: Comprehensive warning flags for GCC, Clang, and MSVC
    • Sanitizers.cmake: Debug build sanitizer support (ASAN, UBSAN, etc.)
    • Dependencies.cmake: Centralized dependency management
    • FinchConfig.cmake.in: Package configuration template
  4. Project Structure

    • finch-core library target
    • finch executable with CLI interface
    • Test infrastructure with GoogleTest
    • Example programs
    • Proper target properties and compile features
  5. Build Features

    • Cross-platform support (Linux, macOS, Windows)
    • Debug/Release build configurations
    • Optional components (tests, examples, docs)
    • Coverage support infrastructure
    • CPack configuration for packaging
  6. Current Status

    • ✅ CMake configures successfully
    • ✅ Project builds without errors
    • ✅ Tests pass (2/2)
    • ✅ Executables run correctly
    • ✅ Version information properly generated

Build Instructions

# Configure
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug

# Build
make -j8

# Run tests
ctest --output-on-failure

# Run executables
./bin/finch --help
./examples/hello_finch

Configuration Options

  • FINCH_BUILD_TESTS: Build test suite (default: ON)
  • FINCH_BUILD_EXAMPLES: Build examples (default: ON)
  • FINCH_BUILD_DOCS: Build documentation (default: OFF)
  • FINCH_ENABLE_COVERAGE: Enable coverage reporting (default: OFF)
  • FINCH_ENABLE_SANITIZERS: Enable sanitizers in Debug builds (default: ON)
  • FINCH_WARNINGS_AS_ERRORS: Treat compiler warnings as errors (default: OFF)
  • FINCH_USE_SYSTEM_DEPS: Use system-installed dependencies (default: OFF)

Known Issues

  1. Installation rules temporarily disabled due to FetchContent dependency export complexity
  2. Some GCC-specific warnings removed from Clang builds to avoid unknown warning errors

Next Steps

  1. Replace dummy source files with actual implementation
  2. Re-enable installation rules with proper dependency handling
  3. Add more comprehensive tests
  4. Implement actual finch functionality (analyze, convert, validate commands)
  5. Eventually use finch to generate Buck2 files for this project (eating our own dogfood)

The CMake build system is now ready for development and serves as a good example of modern CMake practices that finch will eventually convert to Buck2.