DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.73k stars 231 forks source link

Fixed custom target dependency for d3_version.h #440

Closed pzychotic closed 2 weeks ago

pzychotic commented 2 weeks ago

Pull Request Type

Description

cmake/CheckGit.cmake uses configure_file() to create _d3version.h in ${TARGET_DIR}/lib aka ${PROJECT_BINARY_DIR}/lib. But add_custom_command() and add_custom_target() calls in the root CMakeLists.txt use ${PROJECT_BINARY_DIR}/Descent3 as path to that file, expecting it in a different place. While the build still works, since the compiler looks in the right include paths for it, the dependencies between these rules/targets are technically broken. At least msbuild will generate warnings about missing build outputs. You can see it on CI builds before we switched to Ninja: https://github.com/DescentDevelopers/Descent3/pull/429/checks#step:6:405

Also removed the wrong ALL parameter from add_custom_command(), it's only a valid parameter for add_custom_target(). See: https://github.com/DescentDevelopers/Descent3/pull/429/checks#step:6:406

Related Issues

Screenshots (if applicable)

Checklist

Additional Comments

winterheart commented 2 weeks ago

Thanks for pointing it out.