Skip to content

Conversation

@zdenop
Copy link
Contributor

@zdenop zdenop commented Aug 10, 2025

  • Don't use GLOB in CMake files - fixes RFC: Don't use GLOB in CMake files #4442
  • Optimization to improve build speed:
    • Precompiled Headers (PCH) - Enabled by default via ENABLE_PRECOMPILED_HEADERS=ON
    • Unity Builds (Jumbo Builds) - Disabled by default via ENABLE_UNITY_BUILD=OFF. Can reduce compilation time by 30-60% but may increase memory usage
    • ccache Integration - Enabled by default via ENABLE_CCACHE=ON
    • Ninja Job Pools - Enabled by default via ENABLE_NINJA_POOL=ON
  • fix several CMake macos issues

Usage Examples

cmake --build build  -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_UNITY_BUILD=ON
cmake --build build --config Release --target install

@egorpugin
Copy link
Contributor

What is warp2?

Copy link
Contributor

@egorpugin egorpugin left a comment

Choose a reason for hiding this comment

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

It is better to put any code changes outside of this CMake PR.

@zdenop
Copy link
Contributor Author

zdenop commented Aug 11, 2025

macOS CMake CI failed without these non-CMake changes. This is reason why they are in this PR.

@zdenop
Copy link
Contributor Author

zdenop commented Aug 11, 2025

Regarding warp see https://www.warp.dev/

@zdenop zdenop merged commit 17b4d9e into tesseract-ocr:main Aug 15, 2025
13 checks passed
@zdenop zdenop deleted the improve_cmake branch August 15, 2025 21:01
@egorpugin
Copy link
Contributor

What is the purpose of all this?

Someone says GLOBs = bad?
I say GLOBs = good.

What about the rest?
Need of unity/pch/ccache/job pools?

@amitdo
Copy link
Collaborator

amitdo commented Oct 6, 2025

@zdenop,

Since this PR was merged, the macOS+GCC CI job fails.

Could you fix the issue?

@zdenop
Copy link
Contributor Author

zdenop commented Oct 12, 2025

@amitdo: this PR was merged on Aug 15
image
GA started to fail after Sep 17:
image

This issue seems specific to the combination of macOS, CMake, and GCC; other configurations such as macOS with CMake and Clang, or Ubuntu with CMake and GCC, do not show the problem.

image

I do not have access to a macOS device for debugging and testing this scenario.

Additionally, I noticed that the autotools-macos uses only Clang as the compiler on macOS. Perhaps we should consider skipping GCC builds in the CMake workflow for macOS as well.

@zdenop
Copy link
Contributor Author

zdenop commented Oct 12, 2025

Seems like it if fixed.

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.

RFC: Don't use GLOB in CMake files

3 participants