Tribol icon indicating copy to clipboard operation
Tribol copied to clipboard

Define a `TRIBOL_USE_REDECOMP` to use in source

Open ebchin opened this issue 1 year ago • 1 comments

Use TRIBOL_USE_REDECOMP in source instead of BUILD_REDECOMP to match the style used with other #ifdefs

ebchin avatar Oct 31 '24 18:10 ebchin

At this time, Tribol fails to build because BUILD_REDECOMP is undefined at the time TribolConfig.cmake is generating the config.hpp file.

The variable BUILD_REDECOMP is set in src/CMakeLists.txt file, and in CMake the variables have a directory scope, therefore it is still undefined in the parent scope.

As a temporary workaround, I added the option in cmake/Options.cmake and it fixes the issue.

option(TRIBOL_USE_REDECOMP "Enable redecomp" ON)
set(BUILD_REDECOMP ${TRIBOL_USE_REDECOMP})

But why is this an option in the first place, if the library does not build without it? Maybe it should be a mandatary dependency?

giraldeau avatar Jan 10 '25 16:01 giraldeau