Skip to content

Build FirebirdSQL CMake+CLang - #9111

Open
Khalyutin wants to merge 15 commits into
FirebirdSQL:masterfrom
notesoft:path-SQLfb-CMake-LLVM
Open

Build FirebirdSQL CMake+CLang#9111
Khalyutin wants to merge 15 commits into
FirebirdSQL:masterfrom
notesoft:path-SQLfb-CMake-LLVM

Conversation

@Khalyutin

Copy link
Copy Markdown
Contributor

Build FirebirdSQL project with CMake+CLang only (win, lin, osx for amd64 and arm64 ) (except icu4c win prebuild with MSBuild+MSVC)

Build possible as CMake project and sub-project both.

CLI build command in ./builds/cmake/BuildCommandCLI.txt, result zip-forder make in ./distr .

Successful build here: https://github.com/notesoft/SQLfb/actions/runs/30694701552

We plan to support and expand the CMake+CLang build in the future.

The current goal is to minimize the overhead of project builds by unifying the process.

The main goal is to increase the project's popularity by reducing the entry point for new advanced users who need to have their own fork/derivative of industrial open source SQL-server. (like us)

@AlexPeshkoff AlexPeshkoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no problems from regular posix build pov

@asfernandes
asfernandes self-requested a review August 4, 2026 14:11
Comment thread CMakeLists.txt Outdated

if (WIN32)
set(FB_PREFIX "c:\\\\Program Files\\\\Firebird\\\\")
set(FB_PREFIX "c:\\\\Program iles\\\\Firebird\\\\")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like typo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@@ -0,0 +1,44 @@
name: CMake on multiple platforms

on: [push, pull_request]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use only manual like in https://github.com/FirebirdSQL/firebird/blob/master/.github/workflows/static-build.yml#L4
To not avoid more build cost for non-default build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how to run it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only core members could and just after it's merged in master.
You can run in your fork too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, firebird workflows cannot be run in different repositories.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our fork I don't see a place where I can run it`s

Comment thread doc/README.build.cmake.txt Outdated
@@ -0,0 +1,48 @@

Windows:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be in a README in doc/.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to doc\README.build.cmake.txt - ok
need .md / .html ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better .md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

# if the user passed LIBCDS_CXX_STANDARD on the command line, use it
# otherwise default to cxx 11
if (NOT LIBCDS_CXX_STANDARD)
set(LIBCDS_CXX_STANDARD 11 CACHE string "Preferred C++ standard")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using C++11 in the make and msbuild builds?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We not use native "extern/libcds/CMakeLists.txt" as add_subdirectory()

We use instead more simple in "extern/CMakeLists.txt"

https://github.com/FirebirdSQL/firebird/pull/9111/changes#diff-72851cc150ce31165e5ceb4affe9ca78f59bb8f3f61cb6a73d8d25102b5692e3R77-R94

########################################
# LIBRARY cds
########################################

if (USE_CDS)

    set(LIB_cds  "fb-cds-static")
    set(LIB_cds  ${LIB_cds} PARENT_SCOPE)

    file(GLOB cds_src 
        libcds/src/*.cpp
    )  
    add_library                 (${LIB_cds} STATIC ${cds_src})        
    project_group               (${LIB_cds} Extern)

    message("== use cds library from ${CMAKE_CURRENT_BINARY_DIR}/libcds/bin/")

endif()

Comment thread extern/CMakeLists.txt
find_path(ICU_INCLUDE_DIR unicode/ucnv.h
PATHS
/usr/include
/usr/include/x86_64-linux-gnu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if arm?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment thread src/CMakeLists.txt Outdated
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/extern/icu/icudt${ICU_VERSION}l.dat $<TARGET_FILE_DIR:boot_isql>/icudt${ICU_VERSION}l.dat
)

set(ZLIB_BUNARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../extern/zlib/${arch}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUNARY?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Firebird project use prebuild zip1.dll stored in "${CMAKE_CURRENT_SOURCE_DIR}/../extern/zlib/${arch}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I said you were using work BUNARY instead of BINARY.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo ok

Comment thread CMakeLists.txt Outdated
cmake_policy(SET CMP0077 NEW)


option(WITH_LIBTOM_STATIC "on Linux build and link libtommath and libtomcript as static" ON)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use different defaults than the standard build?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our apinion as advanced user of FirebirdSQL:

dynamic link libtommath/libtomcrypt is permanent problem when install clients application many year if it use fbclient (since fbclient uses libtommath).

https://groups.google.com/g/firebird-devel/c/h33ifVfpreY

#9004

We are work with distro

  • RHEL
  • SentOS
  • openSUSE / Leap
  • Ubunta
  • Debian
  • Alpine
  • MacOS
  • Windows
    libtommath/libtomcrypt not installed anywhere by default (except Debian but not sure)

In addition, in RHEL libtommath/libtomcrypt is not included in the standard yum or dnf repository.
(it finded in https://mirror.de.leaseweb.net/epel/10/Everything/x86_64/Packages/l/libtommath-1.3.1~rc1-3.el10_0.x86_64.rpm)

The "find all necessary libraries" quest is undesirable but acceptable for a custom server installation.

This is unacceptable when installing client applications or a production application server. The end business user won't consider using an application that won't launch.

As a result, we ALWAYS have include libtommath/libtomcrypt in the installation distribution. And corrections rpath in MacOS... :(

As libtommath/libtomcrypt is statically linked in the Windows build, I see no reason why this would be a problem in POSIX...

We have long been asking to make the libtommath/libtomcrypt linking static to significantly facilitate the distribution of applications USING FirebirdSQL..

Of couse we will set WITH_LIBTOM_STATIC to OFF if your believe it nessery.

WITH_LIBTOM_STATIC OFF/ON ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree as well to dynamic libtom*, but this is firebird project, isn't it?
Custom individual decisions may be used in forks.
I do not said you can't let the customization point, but looks weird to introduce a custom personal build system in the project not respecting project decisions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants