ltfs icon indicating copy to clipboard operation
ltfs copied to clipboard

Add cmake support

Open madjesc opened this issue 6 months ago • 4 comments

Describe the solution you'd like Add the CMake build system for this project. Even though CMake is not standardized, it's widely used and accepted by the community as the de facto build system.

Describe alternatives you've considered I've also considered Meson but it's not as big

Additional context Autotools is nice but it can be hard to read and a little bit confusing, modern build systems can help this project and improve mantainability.

madjesc avatar May 14 '25 22:05 madjesc

Technically, I don't have any preference about the build tool. But your plan looks so funny to me because I believe we don't need to make a big change against the build related file anymore. Do you have a big plan to change the tree?

Current automake files are really straight forward and I don't have any complain. There is no reason to replace the build system from my perspective.

In addition, you don't have any contribution to this project at all yet. Why you can say CMake can improve mantainability ? I'm feeling you are just familiar with CMake, and are not familiar with automake.

piste-jp avatar May 15 '25 00:05 piste-jp

I don't plan to change the tree, I just want to add the cmake build system not replace autotools.

In addition, you don't have any contribution to this project at all yet. Why you can say CMake can improve mantainability ? I'm feeling you are just familiar with CMake, and are not familiar with automake.

Sorry if this is sudden, but I assigned myself because as you said I'm more familiar with cmake than autotools and I'm willing to write this feature and maintain it. I'm not against autotools at all, but i think adding some CMakeLists.txt could improve build times, and as I said I'm not planning to remove autotools right now.

I't can improve mantainability in the future because:

  1. New C/C++ developers are more familiar with cmake like me
  2. CMake has a simpler and easier syntax than autotools

madjesc avatar May 15 '25 01:05 madjesc

but i think adding some CMakeLists.txt could improve build times

I think the time to create Makefiles might be improved, but actual compile time is quite same because work item that shall be done in the compiler is quite same.

Anyway, I think it is not bad to make progress this feature if you have a time. But I need to ask you to evaluate its effect once you CMakeLists.txt make workable.

piste-jp avatar May 15 '25 02:05 piste-jp

Benchmark

There benchmarks are done using hyperfine with a total test of 5 times.

Makefile generation

Command Mean [s] Min [s] Max [s] Relative
./configure 3.544 ± 0.003 3.542 3.547 3.25 ± 0.03
cd build && cmake .. --fresh 1.092 ± 0.011 1.081 1.103 1.00

Building

Command Mean [s] Min [s] Max [s] Relative
make 20.367 ± 0.600 19.342 20.829 11.10 ± 19.45
cd build && make 1.835 ± 3.216 0.391 7.588 1.00

Building threaded

Command Mean [s] Min [s] Max [s] Relative
make -j 8.663 ± 0.075 8.611 8.793 60.08 ± 0.98
cd build && make -j 0.144 ± 0.002 0.141 0.146 1.00

Thoughts

It seems that CMake does build faster, and it could be faster if the user tries to use ninja instead of make

madjesc avatar Jul 12 '25 19:07 madjesc