Publius - public domain teaching engine

Discussion of chess software programming and technical issues.

Moderator: Ras

abulmo2
Posts: 469
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Publius - public domain teaching engine

Post by abulmo2 »

benvining wrote: Mon Jun 30, 2025 8:15 pm My suggestion is to move to using CMake. It's more cross-platform and way more powerful than Make
I wonder on which platform cmake is available but make is not. Usually cmake builds a makefile and calls make on it. Personally I think cmake is overkill for something as simple as a chess engine.
Richard Delorme
benvining
Posts: 24
Joined: Fri May 30, 2025 10:18 pm
Full name: Ben Vining

Re: Publius - public domain teaching engine

Post by benvining »

which platform cmake is available but make is not
Windows, and cmake also makes it easier to cross compile if you ever need to target iOS or other embedded platforms.

It's not just about portability though, cmake allows you to use Ninja which can speed up the build dramatically. I also use cmake to configure my Doxygen documentation build and all my tests, it's a complete solution.
abulmo2
Posts: 469
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Publius - public domain teaching engine

Post by abulmo2 »

benvining wrote: Tue Jul 01, 2025 8:03 pm
which platform cmake is available but make is not
Windows,
Gnu make is available for windows. and nmake is part of Microsoft visual Studio.
and cmake also makes it easier to cross compile if you ever need to target iOS or other embedded platforms.

It's not just about portability though, cmake allows you to use Ninja which can speed up the build dramatically. I also use cmake to configure my Doxygen documentation build and all my tests, it's a complete solution.
You can cross compile with a makefile. You can target several compilers with a makefile. You can do pgo build with a makefile (not impossible but quite complex with cmake), etc.

As a chess programmer, my need is to do debug version, code coverage version, profiled version , etc of my code, to test and understand it. A Makefile is a perfect tool for that. Chess programs are simple, a few kilolines of code, a dozen files in a single src directory, with no dependency. CMake is a great tool for more complex projects, with hundred of files, millions if lines of code, multiple dependencies, etc. to build an editor, a chess gui, a compiler, etc. but I think it is too complex for a chess program, with more drawbacks than benefits.
Richard Delorme