Skip to content

build: default to Release, gate cat-parts to Windows, translate CMake comments - #146

Closed
chiliec wants to merge 1 commit into
masterfrom
chore/cmake-cleanup
Closed

build: default to Release, gate cat-parts to Windows, translate CMake comments#146
chiliec wants to merge 1 commit into
masterfrom
chore/cmake-cleanup

Conversation

@chiliec

@chiliec chiliec commented Aug 10, 2026

Copy link
Copy Markdown
Member

Three low-risk CMake cleanups from the repo review. No source logic touched.

A. Default CMAKE_BUILD_TYPE to Release when unset

There was no default build type anywhere in the tree. A bare cmake .. — or an IDE that doesn't pass -DCMAKE_BUILD_TYPE — configured the project with empty optimization flags, producing an unoptimized node. Added a standard guard that defaults to Release.

  • Guarded on GENERATOR_IS_MULTI_CONFIG, so multi-config generators (MSVC, Ninja Multi-Config) are left alone — they pick the config at build time and are meant to have an empty CMAKE_BUILD_TYPE.
  • build-linux.sh and build-mac.sh always pass an explicit type, so their behavior is unchanged; this only affects hand/IDE configures that previously got no optimization.

B. Build cat-parts only on MSVC/MinGW

programs/build_helpers/CMakeLists.txt compiled and linked the cat-parts hardfork concatenator on every platform, but libraries/chain/CMakeLists.txt only invokes it under if(MSVC OR MINGW) — Linux and macOS use cat_parts.py instead. So non-Windows builds were compiling+linking a tool they never run. Wrapped add_executable(cat-parts …) in the same if(MSVC OR MINGW) guard.

Verified the only $<TARGET_FILE:cat-parts> reference lives inside the matching MSVC/MinGW branch; the else() path uses Python and never touches the target, so non-Windows builds are unaffected.

C. Translate leftover Romanian CMake comments

Five comments left over from a prior edit were in Romanian. Translated to English to match the rest of the files:

  • CMakeLists.txt# Păstrăm inițializarea…, # bcrypt trebuie sa fie…
  • libraries/chain/CMakeLists.txt# Target comun…, # Marchează fișierul…, # Variabila folosită…

… comments

Three low-risk CMake cleanups; no source logic touched.

- Default CMAKE_BUILD_TYPE to Release when unset on single-config generators.
  Previously a bare `cmake ..` (or an IDE not passing -DCMAKE_BUILD_TYPE)
  configured with empty optimization flags -> an unoptimized node. Guarded on
  GENERATOR_IS_MULTI_CONFIG so MSVC / Ninja Multi-Config are untouched (they
  pick the config at build time). build-linux.sh/build-mac.sh always pass a
  type, so their behavior is unchanged.

- Build cat-parts only on MSVC/MinGW. The hardfork concatenator is invoked
  solely under if(MSVC OR MINGW) in libraries/chain/CMakeLists.txt; every other
  platform uses cat_parts.py. Linux/macOS builds were compiling and linking a
  tool they never run. The only $<TARGET_FILE:cat-parts> reference is inside
  the matching MSVC/MinGW guard, so non-Windows builds are unaffected.

- Translate five leftover Romanian comments (root CMakeLists.txt x2,
  libraries/chain/CMakeLists.txt x3) to English.
On1x added a commit that referenced this pull request Aug 11, 2026
@On1x

On1x commented Aug 11, 2026

Copy link
Copy Markdown
Member

Folded into the pm branch (our mainnet-bound line, PR #124) to keep the HF14 work consistent and avoid master↔pm divergence. Full CI Docker build on pm is green. Closing here since the change now lives in pm; it'll reach master when pm merges. Thanks!

@On1x On1x closed this Aug 11, 2026
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.

2 participants