firebird icon indicating copy to clipboard operation
firebird copied to clipboard

[build][cmake] Update cmake to compile again

Open ezequias2d opened this issue 2 months ago • 1 comments

Heya guys!

This PR provides a update to the CMake build system. My goal was to fix the compilation on Linux (tested on Fedora).

Here is a summary of the main changes:

Key Improvements

  • Modernized CMake: Bumped minimum version to 3.20 and set C++23 / C17 standards globally.
  • Platform/CPU Detection: This adds proper preprocessor definitions (e.g., LINUX, AMD64).
  • Dependency Management:
    • Add libcds and re2 libraries into the build.
    • Added USE_SYSTEM_BOOST and USE_SYSTEM_RE2 options to allow choosing between embedded and system-wide libraries.
  • Build Process Cleanup:
    • Removed the commands for generating msg.fdb.
    • Removed obsolete build targets (codes) and references to deleted source files.
  • Source File Synchronization:
    • Added new source files to CMakeLists.txt that were missing (e.g., in jrd, remote).
    • Removed references to files that no longer exist.

After these changes, I was able to get a successful compilation on Fedora. This is my first contribution, and I'm happy to make any adjustments needed.

ezequias2d avatar Oct 09 '25 21:10 ezequias2d

What is the build commands that works? I tried this and it failled:

cmake -S . -B build-cmake
...
-- Configuring done (9.2s)
CMake Error at src/CMakeLists.txt:997 (add_executable):
  Cannot find source file:

    misc/makeHeader.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc


CMake Error at src/CMakeLists.txt:138 (add_custom_target):
  Cannot find source file:

    /tmp/fb-cmake/src/msgs/facilities2.sql

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc


CMake Error at src/CMakeLists.txt:997 (add_executable):
  No SOURCES given to target: makeHeader

asfernandes avatar Oct 15 '25 11:10 asfernandes