dethrace-labs / dethrace

Reverse engineering the 1997 game "Carmageddon"
https://twitter.com/dethrace_labs
GNU General Public License v3.0
870 stars 46 forks source link

BRender compilation issues with old CMake #377

Open juozaspo opened 5 months ago

juozaspo commented 5 months ago

I'm getting errors while trying to compile dethrace, all related to BRender library. I found that by default, dethrace would provide no files in lib/BRender-v1.3.2 subdirectory and running cmake according to instructions in README.md after cleaning up would fail as there would be no CMakeLists.txt found in lib/BRender-v1.3.2. Cloning BRender-1.3.2 from BRender repository would fail with different error Cannot find source file: FILE_SET. Full cmake logs are listed below.

Running git submodule init and git submodule update as suggested in discord doesn't help. Compilation would still fail as if FILE_SET file would not be found. Updating cmake to 3.23 or newer fixes the error.

cmake Log before cloning Brender ``` -- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- dethrace version v0.7.1-5-g673244b CMake Error at CMakeLists.txt:64 (add_subdirectory): The source directory /home/juozas/dethrace/lib/BRender-v1.3.2 does not contain a CMakeLists.txt file. -- Performing Test HAVE__Wstrict_prototypes -- Performing Test HAVE__Wstrict_prototypes - Success -- Performing Test HAVE__Wformat -- Performing Test HAVE__Wformat - Success -- Performing Test HAVE__Wno_unused_but_set_variable -- Performing Test HAVE__Wno_unused_but_set_variable - Success -- Performing Test HAVE__Wno_unused_variable -- Performing Test HAVE__Wno_unused_variable - Success -- Performing Test HAVE__Wno_unused_result -- Performing Test HAVE__Wno_unused_result - Success -- Performing Test HAVE__Wno_absolute_value -- Performing Test HAVE__Wno_absolute_value - Success -- Configuring incomplete, errors occurred! See also "/home/juozas/dethrace/build/CMakeFiles/CMakeOutput.log". ```
After cloning brender to lib/BRender-v1.3.2 and cleaning up ``` -- The C compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- dethrace version v0.7.1-5-g673244b -- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Perl: /usr/bin/perl (found version "5.34.0") CMake Warning (dev) at lib/BRender-v1.3.2/core/inc/CMakeLists.txt:90 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "inc" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/host/CMakeLists.txt:33 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "host" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/host/CMakeLists.txt:40 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "host" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/fw/CMakeLists.txt:113 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "fw" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/fw/CMakeLists.txt:120 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "fw" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/fmt/CMakeLists.txt:39 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "fmt" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/fmt/CMakeLists.txt:46 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "fmt" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/math/CMakeLists.txt:37 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "math" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/math/CMakeLists.txt:44 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "math" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/pixelmap/CMakeLists.txt:46 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "pixelmap" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/pixelmap/CMakeLists.txt:53 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "pixelmap" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/v1db/CMakeLists.txt:49 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "v1db" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/core/v1db/CMakeLists.txt:56 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "v1db" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at lib/BRender-v1.3.2/x86emu/CMakeLists.txt:16 (target_sources): Policy CMP0076 is not set: target_sources() command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. An interface source of target "x86emu" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. -- Performing Test HAVE__Wstrict_prototypes -- Performing Test HAVE__Wstrict_prototypes - Success -- Performing Test HAVE__Wformat -- Performing Test HAVE__Wformat - Success -- Performing Test HAVE__Wno_unused_but_set_variable -- Performing Test HAVE__Wno_unused_but_set_variable - Success -- Performing Test HAVE__Wno_unused_variable -- Performing Test HAVE__Wno_unused_variable - Success -- Performing Test HAVE__Wno_unused_result -- Performing Test HAVE__Wno_unused_result - Success -- Performing Test HAVE__Wno_absolute_value -- Performing Test HAVE__Wno_absolute_value - Success -- Configuring done CMake Error at lib/BRender-v1.3.2/core/CMakeLists.txt:34 (add_library): Cannot find source file: FILE_SET Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at lib/BRender-v1.3.2/drivers/softrend/CMakeLists.txt:5 (add_library): Cannot find source file: FILE_SET Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc CMake Error at lib/BRender-v1.3.2/drivers/pentprim/CMakeLists.txt:69 (add_library): Cannot find source file: FILE_SET Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly. ```

OS: Ubuntu 22.04 LTS, 64 bit, gcc 11 CMake version: 3.22.1 dethrace commit: 673244bb8c19cdd3041bfd69e0891c504f58757a brender commit: dethrace-labs/BRender-v1.3.2@6d7ce3c58f028c9fa3c1b4e3f290433eb01f7b45

madebr commented 5 months ago

@jeff-1amstudios Do we need to use FILE_SET, or any other new CMake features? Looks like it was added in CMake 3.23.

dethrace-labs commented 4 months ago

Thanks for the report, I'll have a look. A lot of the base cmake bits were taken from the CrocDE port.

For now, I'll increment the cmake_minimum_required to at least make it clear