From f2168d0db49b0c2738954602d57e6a210adb8f51 Mon Sep 17 00:00:00 2001 From: OmniBlade Date: Tue, 16 Feb 2021 12:44:56 +0100 Subject: [PATCH] Initial CMake based build system implementation. --- .gitignore | 2 +- CMakeLists.txt | 20 +++ cmake/FindSDL2.cmake | 255 ++++++++++++++++++++++++++++++++++ lib/libsmacker/CMakeLists.txt | 31 +++++ src/BRSRC13/CMakeLists.txt | 197 ++++++++++++++++++++++++++ src/DETHRACE/CMakeLists.txt | 147 ++++++++++++++++++++ src/harness/CMakeLists.txt | 34 +++++ 7 files changed, 685 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/FindSDL2.cmake create mode 100644 lib/libsmacker/CMakeLists.txt create mode 100644 src/BRSRC13/CMakeLists.txt create mode 100644 src/DETHRACE/CMakeLists.txt create mode 100644 src/harness/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 1856c95a..fb5977b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -build +/build* .DS_Store .vscode diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..c1df3615 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") + +if(NOT DEFINED CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE) +endif() + +project(dethrace C) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +find_package(SDL2 REQUIRED) + +add_subdirectory(lib/libsmacker) +add_subdirectory(lib/miniposix) + +add_subdirectory(src/harness) +add_subdirectory(src/BRSRC13) +add_subdirectory(src/DETHRACE) diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake new file mode 100644 index 00000000..ed26002d --- /dev/null +++ b/cmake/FindSDL2.cmake @@ -0,0 +1,255 @@ +# - Find SDL2 +# Find the SDL2 headers and libraries +# +# SDL2::SDL2 - Imported target to use for building a library +# SDL2::SDL2main - Imported interface target to use if you want SDL and SDLmain. +# SDL2_FOUND - True if SDL2 was found. +# SDL2_DYNAMIC - If we found a DLL version of SDL (meaning you might want to copy a DLL from SDL2::SDL2) +# +# Original Author: +# 2015 Ryan Pavlik +# +# Copyright Sensics, Inc. 2015. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Set up architectures (for windows) and prefixes (for mingw builds) +if(WIN32) + if(MINGW) + include(MinGWSearchPathExtras OPTIONAL) + if(MINGWSEARCH_TARGET_TRIPLE) + set(SDL2_PREFIX ${MINGWSEARCH_TARGET_TRIPLE}) + endif() + endif() + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(SDL2_LIB_PATH_SUFFIX lib/x64) + if(NOT MSVC AND NOT SDL2_PREFIX) + set(SDL2_PREFIX x86_64-w64-mingw32) + endif() + else() + set(SDL2_LIB_PATH_SUFFIX lib/x86) + if(NOT MSVC AND NOT SDL2_PREFIX) + set(SDL2_PREFIX i686-w64-mingw32) + endif() + endif() +else() + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(SDL2_LIB_PATH_SUFFIX lib/x86_64-linux-gnu) + else() + set(SDL2_LIB_PATH_SUFFIX lib/i386-linux-gnu) + endif() +endif() + +if(SDL2_PREFIX) + set(SDL2_ORIGPREFIXPATH ${CMAKE_PREFIX_PATH}) + if(SDL2_ROOT_DIR) + list(APPEND CMAKE_PREFIX_PATH "${SDL2_ROOT_DIR}") + endif() + if(CMAKE_PREFIX_PATH) + foreach(_prefix ${CMAKE_PREFIX_PATH}) + list(APPEND CMAKE_PREFIX_PATH "${_prefix}/${SDL2_PREFIX}") + endforeach() + endif() + if(MINGWSEARCH_PREFIXES) + list(APPEND CMAKE_PREFIX_PATH ${MINGWSEARCH_PREFIXES}) + endif() +endif() + +# Invoke pkgconfig for hints +find_package(PkgConfig QUIET) +set(SDL2_INCLUDE_HINTS) +set(SDL2_LIB_HINTS) +if(PKG_CONFIG_FOUND) + pkg_search_module(SDL2PC QUIET sdl2) + if(SDL2PC_INCLUDE_DIRS) + set(SDL2_INCLUDE_HINTS ${SDL2PC_INCLUDE_DIRS}) + endif() + if(SDL2PC_LIBRARY_DIRS) + set(SDL2_LIB_HINTS ${SDL2PC_LIBRARY_DIRS}) + endif() +endif() + +include(FindPackageHandleStandardArgs) + +find_library(SDL2_LIBRARY + NAMES + SDL2 + HINTS + ${SDL2_LIB_HINTS} + PATHS + ${SDL2_ROOT_DIR} + ENV SDL2DIR + PATH_SUFFIXES lib SDL2 ${SDL2_LIB_PATH_SUFFIX}) + +set(_sdl2_framework FALSE) +# Some special-casing if we've found/been given a framework. +# Handles whether we're given the library inside the framework or the framework itself. +if(APPLE AND "${SDL2_LIBRARY}" MATCHES "(/[^/]+)*.framework(/.*)?$") + set(_sdl2_framework TRUE) + set(SDL2_FRAMEWORK "${SDL2_LIBRARY}") + # Move up in the directory tree as required to get the framework directory. + while("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework(/.*)$" AND NOT "${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$") + get_filename_component(SDL2_FRAMEWORK "${SDL2_FRAMEWORK}" DIRECTORY) + endwhile() + if("${SDL2_FRAMEWORK}" MATCHES "(/[^/]+)*.framework$") + set(SDL2_FRAMEWORK_NAME ${CMAKE_MATCH_1}) + # If we found a framework, do a search for the header ahead of time that will be more likely to get the framework header. + find_path(SDL2_INCLUDE_DIR + NAMES + SDL_haptic.h # this file was introduced with SDL2 + HINTS + "${SDL2_FRAMEWORK}/Headers/") + else() + # For some reason we couldn't get the framework directory itself. + # Shouldn't happen, but might if something is weird. + unset(SDL2_FRAMEWORK) + endif() +endif() + +find_path(SDL2_INCLUDE_DIR + NAMES + SDL_haptic.h # this file was introduced with SDL2 + HINTS + ${SDL2_INCLUDE_HINTS} + PATHS + ${SDL2_ROOT_DIR} + ENV SDL2DIR + PATH_SUFFIXES include include/sdl2 include/SDL2 SDL2) + +if(WIN32 AND SDL2_LIBRARY) + find_file(SDL2_RUNTIME_LIBRARY + NAMES + SDL2.dll + libSDL2.dll + HINTS + ${SDL2_LIB_HINTS} + PATHS + ${SDL2_ROOT_DIR} + ENV SDL2DIR + PATH_SUFFIXES bin lib ${SDL2_LIB_PATH_SUFFIX}) +endif() + + +if(WIN32 OR ANDROID OR IOS OR (APPLE AND NOT _sdl2_framework)) + set(SDL2_EXTRA_REQUIRED SDL2_SDLMAIN_LIBRARY) + find_library(SDL2_SDLMAIN_LIBRARY + NAMES + SDL2main + PATHS + ${SDL2_ROOT_DIR} + ENV SDL2DIR + PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX}) +endif() + +if(MINGW AND NOT SDL2PC_FOUND) + find_library(SDL2_MINGW_LIBRARY mingw32) + find_library(SDL2_MWINDOWS_LIBRARY mwindows) +endif() + +if(SDL2_PREFIX) + # Restore things the way they used to be. + set(CMAKE_PREFIX_PATH ${SDL2_ORIGPREFIXPATH}) +endif() + +# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SDL2 + DEFAULT_MSG + SDL2_LIBRARY + SDL2_INCLUDE_DIR + ${SDL2_EXTRA_REQUIRED}) + +if(SDL2_FOUND) + if(NOT TARGET SDL2::SDL2) + # Create SDL2::SDL2 + if(WIN32 AND SDL2_RUNTIME_LIBRARY) + set(SDL2_DYNAMIC TRUE) + add_library(SDL2::SDL2 SHARED IMPORTED) + set_target_properties(SDL2::SDL2 + PROPERTIES + IMPORTED_IMPLIB "${SDL2_LIBRARY}" + IMPORTED_LOCATION "${SDL2_RUNTIME_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" + ) + else() + add_library(SDL2::SDL2 UNKNOWN IMPORTED) + if(SDL2_FRAMEWORK AND SDL2_FRAMEWORK_NAME) + # Handle the case that SDL2 is a framework and we were able to decompose it above. + set_target_properties(SDL2::SDL2 PROPERTIES + IMPORTED_LOCATION "${SDL2_FRAMEWORK}/${SDL2_FRAMEWORK_NAME}") + elseif(_sdl2_framework AND SDL2_LIBRARY MATCHES "(/[^/]+)*.framework$") + # Handle the case that SDL2 is a framework and SDL_LIBRARY is just the framework itself. + + # This takes the basename of the framework, without the extension, + # and sets it (as a child of the framework) as the imported location for the target. + # This is the library symlink inside of the framework. + set_target_properties(SDL2::SDL2 PROPERTIES + IMPORTED_LOCATION "${SDL2_LIBRARY}/${CMAKE_MATCH_1}") + else() + # Handle non-frameworks (including non-Mac), as well as the case that we're given the library inside of the framework + set_target_properties(SDL2::SDL2 PROPERTIES + IMPORTED_LOCATION "${SDL2_LIBRARY}") + endif() + set_target_properties(SDL2::SDL2 + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" + ) + endif() + + if(APPLE) + # Need Cocoa here, is always a framework + find_library(SDL2_COCOA_LIBRARY Cocoa) + list(APPEND SDL2_EXTRA_REQUIRED SDL2_COCOA_LIBRARY) + if(SDL2_COCOA_LIBRARY) + set_target_properties(SDL2::SDL2 PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES ${SDL2_COCOA_LIBRARY}) + endif() + endif() + + + # Compute what to do with SDL2main + set(SDL2MAIN_LIBRARIES SDL2::SDL2) + add_library(SDL2::SDL2main INTERFACE IMPORTED) + if(SDL2_SDLMAIN_LIBRARY) + add_library(SDL2::SDL2main_real STATIC IMPORTED) + set_target_properties(SDL2::SDL2main_real + PROPERTIES + IMPORTED_LOCATION "${SDL2_SDLMAIN_LIBRARY}") + set(SDL2MAIN_LIBRARIES SDL2::SDL2main_real ${SDL2MAIN_LIBRARIES}) + endif() + if(MINGW) + # MinGW requires some additional libraries to appear earlier in the link line. + if(SDL2PC_LIBRARIES) + # Use pkgconfig-suggested extra libraries if available. + list(REMOVE_ITEM SDL2PC_LIBRARIES SDL2main SDL2) + set(SDL2MAIN_LIBRARIES ${SDL2PC_LIBRARIES} ${SDL2MAIN_LIBRARIES}) + else() + # fall back to extra libraries specified in pkg-config in + # an official binary distro of SDL2 for MinGW I downloaded + if(SDL2_MINGW_LIBRARY) + set(SDL2MAIN_LIBRARIES ${SDL2_MINGW_LIBRARY} ${SDL2MAIN_LIBRARIES}) + endif() + if(SDL2_MWINDOWS_LIBRARY) + set(SDL2MAIN_LIBRARIES ${SDL2_MWINDOWS_LIBRARY} ${SDL2MAIN_LIBRARIES}) + endif() + endif() + set_target_properties(SDL2::SDL2main + PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "main=SDL_main") + endif() + set_target_properties(SDL2::SDL2main + PROPERTIES + INTERFACE_LINK_LIBRARIES "${SDL2MAIN_LIBRARIES}") + endif() + mark_as_advanced(SDL2_ROOT_DIR) +endif() + +mark_as_advanced(SDL2_LIBRARY + SDL2_RUNTIME_LIBRARY + SDL2_INCLUDE_DIR + SDL2_SDLMAIN_LIBRARY + SDL2_COCOA_LIBRARY + SDL2_MINGW_LIBRARY + SDL2_MWINDOWS_LIBRARY) diff --git a/lib/libsmacker/CMakeLists.txt b/lib/libsmacker/CMakeLists.txt new file mode 100644 index 00000000..b3dfd029 --- /dev/null +++ b/lib/libsmacker/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") + +if(NOT DEFINED CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE) +endif() + +project(smacker C) + +add_library(smacker STATIC) + +target_include_directories(smacker PUBLIC + . +) + +if(NOT MSVC) + target_compile_options(smacker PRIVATE -Wall) +else() + target_compile_definitions(smacker PRIVATE -D_CRT_SECURE_NO_WARNINGS) +endif() + +target_sources(smacker PRIVATE + smacker.c + smk_bitstream.c + smk_hufftree.c + smacker.h + smk_bitstream.h + smk_hufftree.h + smk_malloc.h +) diff --git a/src/BRSRC13/CMakeLists.txt b/src/BRSRC13/CMakeLists.txt new file mode 100644 index 00000000..141a9c6e --- /dev/null +++ b/src/BRSRC13/CMakeLists.txt @@ -0,0 +1,197 @@ +add_library(brender STATIC) + +target_include_directories(brender PUBLIC + . + CORE/DOSIO + CORE/FW + CORE/HOST + CORE/MATH + CORE/PIXELMAP + CORE/STD + CORE/V1DB + ${CMAKE_SOURCE_DIR}/src/harness +) + +target_link_libraries(brender PRIVATE harness miniposix SDL2::SDL2) + +if(NOT MSVC) + target_compile_options(brender PRIVATE + -g + -Wno-return-type + -Wno-missing-declarations + -Werror=implicit-function-declaration + ) + + target_link_libraries(brender PUBLIC m) +else() + target_compile_definitions(brender PRIVATE -D_CRT_SECURE_NO_WARNINGS) + target_compile_options(brender PRIVATE + /wd4101 + /wd4996 + ) +endif() + +target_sources(brender PRIVATE + brender.h + br_types.h + CORE/DOSIO/dosio.c + CORE/DOSIO/dosio.h + CORE/DOSIO/eventq.c + CORE/DOSIO/eventq.h + CORE/DOSIO/readmse.c + CORE/DOSIO/readmse.h + CORE/FW/assocarr.c + CORE/FW/assocarr.h + CORE/FW/brbegin.c + CORE/FW/brbegin.h + CORE/FW/brbhook.c + CORE/FW/brbhook.h + CORE/FW/brlists.c + CORE/FW/brlists.h + CORE/FW/brprintf.c + CORE/FW/brprintf.h + CORE/FW/brqsort.c + CORE/FW/brqsort.h + CORE/FW/bswap.c + CORE/FW/bswap.h + CORE/FW/datafile.c + CORE/FW/datafile.h + CORE/FW/devlist.c + CORE/FW/devlist.h + CORE/FW/devsetup.c + CORE/FW/devsetup.h + CORE/FW/diag.c + CORE/FW/diag.h + CORE/FW/error.c + CORE/FW/error.h + CORE/FW/file.c + CORE/FW/file.h + CORE/FW/fwsetup.c + CORE/FW/fwsetup.h + CORE/FW/genfile.c + CORE/FW/genfile.h + CORE/FW/image.c + CORE/FW/image.h + CORE/FW/lexer.c + CORE/FW/lexer.h + CORE/FW/loader.c + CORE/FW/loader.h + CORE/FW/mem.c + CORE/FW/mem.h + CORE/FW/object.c + CORE/FW/object.h + CORE/FW/objectc.c + CORE/FW/objectc.h + CORE/FW/pattern.c + CORE/FW/pattern.h + CORE/FW/register.c + CORE/FW/register.h + CORE/FW/resource.c + CORE/FW/resource.h + CORE/FW/resreg.c + CORE/FW/resreg.h + CORE/FW/scratch.c + CORE/FW/scratch.h + CORE/FW/sys_conf.c + CORE/FW/sys_conf.h + CORE/FW/token.c + CORE/FW/token.h + CORE/FW/tokenval.c + CORE/FW/tokenval.h + CORE/HOST/himage.c + CORE/HOST/himage.h + CORE/HOST/hook.c + CORE/HOST/hook.h + CORE/HOST/hostcfg.c + CORE/HOST/hostcfg.h + CORE/HOST/hstsetup.c + CORE/HOST/hstsetup.h + CORE/HOST/memmgmt.c + CORE/HOST/memmgmt.h + CORE/MATH/angles.c + CORE/MATH/angles.h + CORE/MATH/matrix23.c + CORE/MATH/matrix23.h + CORE/MATH/matrix34.c + CORE/MATH/matrix34.h + CORE/MATH/matrix4.c + CORE/MATH/matrix4.h + CORE/MATH/plane.c + CORE/MATH/plane.h + CORE/MATH/quat.c + CORE/MATH/quat.h + CORE/MATH/transfrm.c + CORE/MATH/transfrm.h + CORE/MATH/vector.c + CORE/MATH/vector.h + CORE/PIXELMAP/fontptrs.c + CORE/PIXELMAP/fontptrs.h + CORE/PIXELMAP/genclip.c + CORE/PIXELMAP/genclip.h + CORE/PIXELMAP/gencopy.c + CORE/PIXELMAP/gencopy.h + CORE/PIXELMAP/pixelmap.c + CORE/PIXELMAP/pixelmap.h + CORE/PIXELMAP/pmdsptch.c + CORE/PIXELMAP/pmdsptch.h + CORE/PIXELMAP/pmfile.c + CORE/PIXELMAP/pmfile.h + CORE/PIXELMAP/pmgen.c + CORE/PIXELMAP/pmgen.h + CORE/PIXELMAP/pmmem.c + CORE/PIXELMAP/pmmem.h + CORE/PIXELMAP/pmnull.c + CORE/PIXELMAP/pmnull.h + CORE/PIXELMAP/pmsetup.c + CORE/PIXELMAP/pmsetup.h + CORE/STD/brexcept.c + CORE/STD/brexcept.h + CORE/STD/brmath.c + CORE/STD/brmath.h + CORE/STD/brstddiag.c + CORE/STD/brstddiag.h + CORE/STD/brstdfile.c + CORE/STD/brstdfile.h + CORE/STD/brstdlib.c + CORE/STD/brstdlib.h + CORE/STD/brstdmem.c + CORE/STD/brstdmem.h + CORE/STD/logwrite.c + CORE/STD/logwrite.h + CORE/V1DB/actsupt.c + CORE/V1DB/actsupt.h + CORE/V1DB/custsupt.c + CORE/V1DB/custsupt.h + CORE/V1DB/dbsetup.c + CORE/V1DB/dbsetup.h + CORE/V1DB/def_mat.c + CORE/V1DB/def_mat.h + CORE/V1DB/def_mdl.c + CORE/V1DB/def_mdl.h + CORE/V1DB/def_otab.c + CORE/V1DB/def_otab.h + CORE/V1DB/enables.c + CORE/V1DB/enables.h + CORE/V1DB/matsupt.c + CORE/V1DB/matsupt.h + CORE/V1DB/modrend.c + CORE/V1DB/modrend.h + CORE/V1DB/modsupt.c + CORE/V1DB/modsupt.h + CORE/V1DB/otable.c + CORE/V1DB/otable.h + CORE/V1DB/prepmap.c + CORE/V1DB/prepmap.h + CORE/V1DB/prepmatl.c + CORE/V1DB/prepmatl.h + CORE/V1DB/prepmesh.c + CORE/V1DB/prepmesh.h + CORE/V1DB/preptab.c + CORE/V1DB/preptab.h + CORE/V1DB/regsupt.c + CORE/V1DB/regsupt.h + CORE/V1DB/render.c + CORE/V1DB/render.h + CORE/V1DB/v1dbfile.c + CORE/V1DB/v1dbfile.h +) diff --git a/src/DETHRACE/CMakeLists.txt b/src/DETHRACE/CMakeLists.txt new file mode 100644 index 00000000..187b299b --- /dev/null +++ b/src/DETHRACE/CMakeLists.txt @@ -0,0 +1,147 @@ +add_executable(dethrace) + +target_include_directories(dethrace PRIVATE + . + common + pc-dos + ${CMAKE_SOURCE_DIR}/lib + ${CMAKE_SOURCE_DIR}/src/harness + ${CMAKE_SOURCE_DIR}/src/BRSRC13 +) + +target_link_libraries(dethrace PRIVATE smacker harness brender miniposix SDL2::SDL2) + +if(NOT MSVC) + target_compile_options(dethrace PRIVATE + -g + -Wno-return-type + -Wno-missing-declarations + -Werror=implicit-function-declaration + ) + + if(APPLE) + target_link_libraries(dethrace PRIVATE "-framework OpenGL") + else() + target_link_libraries(dethrace PRIVATE GL) + endif() +else() + target_compile_definitions(dethrace PRIVATE -D_CRT_SECURE_NO_WARNINGS) + target_compile_options(dethrace PRIVATE + /wd4101 + /wd4996 + ) +endif() + +target_sources(dethrace PRIVATE + common/brucetrk.c + common/brucetrk.h + common/car.c + common/car.h + common/controls.c + common/controls.h + common/crush.c + common/crush.h + common/cutscene.c + common/cutscene.h + common/demo.c + common/demo.h + common/depth.c + common/depth.h + common/displays.c + common/displays.h + common/drfile.c + common/drfile.h + common/drmem.c + common/drmem.h + common/errors.c + common/errors.h + common/finteray.c + common/finteray.h + common/flicplay.c + common/flicplay.h + common/globvars.c + common/globvars.h + common/globvrbm.c + common/globvrbm.h + common/globvrkm.c + common/globvrkm.h + common/globvrme.c + common/globvrme.h + common/globvrpb.c + common/globvrpb.h + common/grafdata.c + common/grafdata.h + common/graphics.c + common/graphics.h + common/init.c + common/init.h + common/input.c + common/input.h + common/intrface.c + common/intrface.h + common/loading.c + common/loading.h + common/loadsave.c + common/loadsave.h + common/main.c + common/main.h + common/mainloop.c + common/mainloop.h + common/mainmenu.c + common/mainmenu.h + common/netgame.c + common/netgame.h + common/network.c + common/network.h + common/newgame.c + common/newgame.h + common/oil.c + common/oil.h + common/oppocar.c + common/oppocar.h + common/opponent.c + common/opponent.h + common/oppoproc.c + common/oppoproc.h + common/options.c + common/options.h + common/pedestrn.c + common/pedestrn.h + common/piping.c + common/piping.h + common/powerup.c + common/powerup.h + common/pratcam.c + common/pratcam.h + common/racestrt.c + common/racestrt.h + common/racesumm.c + common/racesumm.h + common/raycast.c + common/raycast.h + common/replay.c + common/replay.h + common/skidmark.c + common/skidmark.h + common/sound.c + common/sound.h + common/spark.c + common/spark.h + common/structur.c + common/structur.h + common/trig.c + common/trig.h + common/utility.c + common/utility.h + common/world.c + common/world.h + constants.h + dr_types.h + main.c + pc-dos/dosnet.c + pc-dos/dosnet.h + pc-dos/dossys.c + pc-dos/dossys.h + watcom_functions.c + watcom_functions.h +) \ No newline at end of file diff --git a/src/harness/CMakeLists.txt b/src/harness/CMakeLists.txt new file mode 100644 index 00000000..7e8e8fe6 --- /dev/null +++ b/src/harness/CMakeLists.txt @@ -0,0 +1,34 @@ +add_library(harness OBJECT) + +target_include_directories(harness PRIVATE + . + ${CMAKE_SOURCE_DIR}/src/BRSRC13 + ${CMAKE_SOURCE_DIR}/src/DETHRACE +) + +target_link_libraries(harness PRIVATE miniposix SDL2::SDL2) + +if(NOT MSVC) + target_compile_options(harness PRIVATE + -g + -Wno-return-type + -Wno-missing-declarations + -Werror=implicit-function-declaration + ) +else() + target_compile_definitions(harness PRIVATE -D_CRT_SECURE_NO_WARNINGS) +endif() + +target_sources(harness PRIVATE + debug.c + debug.h + harness.c + harness.h + input/keyboard.c + input/keyboard.h + renderers/gl_renderer.c + renderers/gl_renderer.h + renderers/null_renderer.c + renderers/null_renderer.h + stack_trace_handler.h +) \ No newline at end of file