]> git.ipfire.org Git - thirdparty/zstd.git/commit
refactor: modularize CMakeLists.txt for better maintainability
authorYann Collet <Cyan4973@users.noreply.github.com>
Mon, 9 Jun 2025 03:47:33 +0000 (03:47 +0000)
committerYann Collet <Cyan4973@users.noreply.github.com>
Mon, 9 Jun 2025 03:47:33 +0000 (03:47 +0000)
commit49fe2ec79332b6706bdcac3ddca6c15a84da85b1
treeb88d4a10646cf1bcd4947633d5421534b812152b
parent75abb8bc1c4cf57c994204a7e01552c2fad94a90
refactor: modularize CMakeLists.txt for better maintainability

- Split monolithic 235-line CMakeLists.txt into focused modules
- Main file reduced to 78 lines with clear section organization
- Created 5 specialized modules:
  * ZstdVersion.cmake - CMake policies and version management
  * ZstdOptions.cmake - Build options and platform configuration
  * ZstdDependencies.cmake - External dependency management
  * ZstdBuild.cmake - Build targets and validation
  * ZstdPackage.cmake - Package configuration generation

Benefits:
- Improved readability and maintainability
- Better separation of concerns
- Easier debugging and modification
- Preserved 100% backward compatibility
- All existing build options and targets unchanged

The refactored build system passes all tests and maintains
identical functionality while being much easier to understand
and maintain.
build/cmake/CMakeLists.txt
build/cmake/CMakeModules/ZstdBuild.cmake [new file with mode: 0644]
build/cmake/CMakeModules/ZstdDependencies.cmake [new file with mode: 0644]
build/cmake/CMakeModules/ZstdOptions.cmake [new file with mode: 0644]
build/cmake/CMakeModules/ZstdPackage.cmake [new file with mode: 0644]
build/cmake/CMakeModules/ZstdVersion.cmake [new file with mode: 0644]