From 07c30a20c222a84b92f0686e37c8be54508c8c71 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 28 Nov 2022 21:46:43 -0800 Subject: [PATCH 1/2] Move all sources into CMakeLists.txt Changing Sourcefile did not automatically update the CMake cache. --- CMakeLists.txt | 7 -- src/CMakeLists.txt | 137 ++++++++++++++++++++++++++++++++++-- src/Sourcefile | 127 --------------------------------- src/blua/CMakeLists.txt | 28 +++++++- src/blua/Sourcefile | 25 ------- src/hardware/CMakeLists.txt | 16 ++++- src/hardware/Sourcefile | 13 ---- src/objects/CMakeLists.txt | 12 +++- src/objects/Sourcefile | 9 --- src/sdl/CMakeLists.txt | 19 +++-- src/sdl/Sourcefile | 7 -- 11 files changed, 197 insertions(+), 203 deletions(-) delete mode 100644 src/Sourcefile delete mode 100644 src/blua/Sourcefile delete mode 100644 src/hardware/Sourcefile delete mode 100644 src/objects/Sourcefile delete mode 100644 src/sdl/Sourcefile diff --git a/CMakeLists.txt b/CMakeLists.txt index c6cd6c3d4..c816ddc06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,13 +125,6 @@ if ((${SRB2_USE_CCACHE}) AND (${CMAKE_C_COMPILER} MATCHES "clang")) message(WARNING "Using clang and CCache: You may want to set environment variable CCACHE_CPP2=yes to prevent include errors during compile.") endif() -# Add sources from Sourcefile -function(target_sourcefile type) - file(STRINGS Sourcefile list - REGEX "[-0-9A-Za-z_]+\.${type}") - target_sources(SRB2SDL2 PRIVATE ${list}) -endfunction() - # bitness check set(SRB2_SYSTEM_BITS 0) if(CMAKE_SIZEOF_VOID_P EQUAL 8) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b681d042..cc04e2cba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,135 @@ -add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32) +add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 + comptime.c + md5.c + config.h.in + string.c + d_main.c + d_clisrv.c + d_net.c + d_netfil.c + d_netcmd.c + dehacked.c + deh_soc.c + deh_lua.c + deh_tables.c + z_zone.c + f_finale.c + f_wipe.c + g_demo.c + g_game.c + g_input.c + g_splitscreen.c + am_map.c + command.c + console.c + font.c + hu_stuff.c + i_time.c + y_inter.c + st_stuff.c + m_aatree.c + m_anigif.c + m_argv.c + m_bbox.c + m_cheat.c + m_cond.c + m_easing.c + m_fixed.c + m_misc.c + m_perfstats.c + m_random.c + m_queue.c + info.c + p_ceilng.c + p_enemy.c + p_floor.c + p_inter.c + p_lights.c + p_map.c + p_maputl.c + p_mobj.c + p_polyobj.c + p_saveg.c + p_setup.c + p_sight.c + p_spec.c + p_telept.c + p_tick.c + p_user.c + p_slopes.c + tables.c + r_bsp.c + r_data.c + r_draw.c + r_fps.c + r_main.c + r_plane.c + r_segs.c + r_skins.c + r_sky.c + r_splats.c + r_things.c + r_bbox.c + r_textures.c + r_patch.c + r_patchrotation.c + r_picformats.c + r_portal.c + screen.c + taglist.c + v_video.c + s_sound.c + sounds.c + w_wad.c + filesrch.c + mserv.c + http-mserv.c + i_tcp.c + lzf.c + vid_copy.s + lua_script.c + lua_baselib.c + lua_mathlib.c + lua_hooklib.c + lua_consolelib.c + lua_infolib.c + lua_mobjlib.c + lua_playerlib.c + lua_skinlib.c + lua_thinkerlib.c + lua_maplib.c + lua_taglib.c + lua_polyobjlib.c + lua_blockmaplib.c + lua_hudlib.c + lua_hudlib_drawlist.c + k_kart.c + k_respawn.c + k_collide.c + k_color.c + k_race.c + k_battle.c + k_pwrlv.c + k_waypoint.c + k_pathfind.c + k_bheap.c + k_bot.c + k_botitem.c + k_botsearch.c + k_grandprix.c + k_boss.c + k_hud.c + k_menudef.c + k_menufunc.c + k_menudraw.c + k_terrain.c + k_brightmap.c + k_terrain.c + k_director.c + k_follower.c + k_profiles.c + k_specialstage.c +) if("${CMAKE_COMPILER_IS_GNUCC}" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows" AND NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}" AND NOT "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}") # On MinGW with internal libraries, link the standard library statically @@ -7,10 +138,6 @@ endif() set_property(TARGET SRB2SDL2 PROPERTY C_STANDARD 11) -# Core sources -target_sourcefile(c) -target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h.in) - set(SRB2_ASM_SOURCES vid_copy.s) set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas) diff --git a/src/Sourcefile b/src/Sourcefile deleted file mode 100644 index f2aa652b1..000000000 --- a/src/Sourcefile +++ /dev/null @@ -1,127 +0,0 @@ -string.c -d_main.c -d_clisrv.c -d_net.c -d_netfil.c -d_netcmd.c -dehacked.c -deh_soc.c -deh_lua.c -deh_tables.c -z_zone.c -f_finale.c -f_wipe.c -g_demo.c -g_game.c -g_input.c -g_splitscreen.c -am_map.c -command.c -console.c -font.c -hu_stuff.c -i_time.c -y_inter.c -st_stuff.c -m_aatree.c -m_anigif.c -m_argv.c -m_bbox.c -m_cheat.c -m_cond.c -m_easing.c -m_fixed.c -m_misc.c -m_perfstats.c -m_random.c -m_queue.c -info.c -p_ceilng.c -p_enemy.c -p_floor.c -p_inter.c -p_lights.c -p_map.c -p_maputl.c -p_mobj.c -p_polyobj.c -p_saveg.c -p_setup.c -p_sight.c -p_spec.c -p_telept.c -p_tick.c -p_user.c -p_slopes.c -tables.c -r_bsp.c -r_data.c -r_draw.c -r_fps.c -r_main.c -r_plane.c -r_segs.c -r_skins.c -r_sky.c -r_splats.c -r_things.c -r_bbox.c -r_textures.c -r_patch.c -r_patchrotation.c -r_picformats.c -r_portal.c -screen.c -taglist.c -v_video.c -s_sound.c -sounds.c -w_wad.c -filesrch.c -mserv.c -http-mserv.c -i_tcp.c -lzf.c -vid_copy.s -lua_script.c -lua_baselib.c -lua_mathlib.c -lua_hooklib.c -lua_consolelib.c -lua_infolib.c -lua_mobjlib.c -lua_playerlib.c -lua_skinlib.c -lua_thinkerlib.c -lua_maplib.c -lua_taglib.c -lua_polyobjlib.c -lua_blockmaplib.c -lua_hudlib.c -lua_hudlib_drawlist.c -k_kart.c -k_respawn.c -k_collide.c -k_color.c -k_race.c -k_battle.c -k_pwrlv.c -k_waypoint.c -k_pathfind.c -k_bheap.c -k_bot.c -k_botitem.c -k_botsearch.c -k_grandprix.c -k_boss.c -k_hud.c -k_menudef.c -k_menufunc.c -k_menudraw.c -k_terrain.c -k_brightmap.c -k_terrain.c -k_director.c -k_follower.c -k_profiles.c -k_specialstage.c diff --git a/src/blua/CMakeLists.txt b/src/blua/CMakeLists.txt index 4e9c67d2f..afe03fdc5 100644 --- a/src/blua/CMakeLists.txt +++ b/src/blua/CMakeLists.txt @@ -1 +1,27 @@ -target_sourcefile(c) +target_sources(SRB2SDL2 PRIVATE + lapi.c + lbaselib.c + ldo.c + lfunc.c + linit.c + liolib.c + llex.c + lmem.c + lobject.c + lstate.c + lstrlib.c + ltablib.c + lundump.c + lzio.c + lauxlib.c + lcode.c + ldebug.c + ldump.c + lgc.c + lopcodes.c + lparser.c + lstring.c + ltable.c + ltm.c + lvm.c +) diff --git a/src/blua/Sourcefile b/src/blua/Sourcefile deleted file mode 100644 index f99c89c8d..000000000 --- a/src/blua/Sourcefile +++ /dev/null @@ -1,25 +0,0 @@ -lapi.c -lbaselib.c -ldo.c -lfunc.c -linit.c -liolib.c -llex.c -lmem.c -lobject.c -lstate.c -lstrlib.c -ltablib.c -lundump.c -lzio.c -lauxlib.c -lcode.c -ldebug.c -ldump.c -lgc.c -lopcodes.c -lparser.c -lstring.c -ltable.c -ltm.c -lvm.c diff --git a/src/hardware/CMakeLists.txt b/src/hardware/CMakeLists.txt index 4e9c67d2f..a0a0f280c 100644 --- a/src/hardware/CMakeLists.txt +++ b/src/hardware/CMakeLists.txt @@ -1 +1,15 @@ -target_sourcefile(c) +target_sources(SRB2SDL2 PRIVATE + hw_bsp.c + hw_draw.c + hw_light.c + hw_main.c + hw_clip.c + hw_md2.c + hw_cache.c + hw_md2load.c + hw_md3load.c + hw_model.c + u_list.c + hw_batching.c + r_opengl/r_opengl.c +) diff --git a/src/hardware/Sourcefile b/src/hardware/Sourcefile deleted file mode 100644 index 1c05de76c..000000000 --- a/src/hardware/Sourcefile +++ /dev/null @@ -1,13 +0,0 @@ -hw_bsp.c -hw_draw.c -hw_light.c -hw_main.c -hw_clip.c -hw_md2.c -hw_cache.c -hw_md2load.c -hw_md3load.c -hw_model.c -u_list.c -hw_batching.c -r_opengl/r_opengl.c diff --git a/src/objects/CMakeLists.txt b/src/objects/CMakeLists.txt index 4e9c67d2f..f02428382 100644 --- a/src/objects/CMakeLists.txt +++ b/src/objects/CMakeLists.txt @@ -1 +1,11 @@ -target_sourcefile(c) +target_sources(SRB2SDL2 PRIVATE + hyudoro.c + gardentop.c + shrink.c + item-debris.c + spb.c + manta-ring.c + orbinaut.c + jawz.c + duel-bomb.c +) diff --git a/src/objects/Sourcefile b/src/objects/Sourcefile deleted file mode 100644 index b8cb63b1f..000000000 --- a/src/objects/Sourcefile +++ /dev/null @@ -1,9 +0,0 @@ -hyudoro.c -gardentop.c -shrink.c -item-debris.c -spb.c -manta-ring.c -orbinaut.c -jawz.c -duel-bomb.c diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index dd8d304a4..ee9c4cddc 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -1,12 +1,17 @@ # Declare SDL2 interface sources -target_sources(SRB2SDL2 PRIVATE mixer_sound.c) - -target_sourcefile(c) - -target_sources(SRB2SDL2 PRIVATE ogl_sdl.c) - -target_sources(SRB2SDL2 PRIVATE i_threads.c) +target_sources(SRB2SDL2 PRIVATE + mixer_sound.c + ogl_sdl.c + i_threads.c + i_net.c + i_system.c + i_main.c + i_video.c + dosstr.c + endtxt.c + hwsym_sdl.c +) if(${SRB2_USEASM}) set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES LANGUAGE C) diff --git a/src/sdl/Sourcefile b/src/sdl/Sourcefile deleted file mode 100644 index 82d5ce073..000000000 --- a/src/sdl/Sourcefile +++ /dev/null @@ -1,7 +0,0 @@ -i_net.c -i_system.c -i_main.c -i_video.c -dosstr.c -endtxt.c -hwsym_sdl.c From 3f2209b853b90d12e6ccfa4d7c5f4090df4bd5be Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 15 Dec 2022 19:55:29 -0500 Subject: [PATCH 2/2] Newly added files to CMakeLists.txt --- src/CMakeLists.txt | 1 + src/objects/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bed2d5532..61e5ff86f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -129,6 +129,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 k_follower.c k_profiles.c k_specialstage.c + k_roulette.c ) if("${CMAKE_COMPILER_IS_GNUCC}" AND "${CMAKE_SYSTEM_NAME}" MATCHES "Windows" AND NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}" AND NOT "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}") diff --git a/src/objects/CMakeLists.txt b/src/objects/CMakeLists.txt index f02428382..b3b5ff2c0 100644 --- a/src/objects/CMakeLists.txt +++ b/src/objects/CMakeLists.txt @@ -8,4 +8,5 @@ target_sources(SRB2SDL2 PRIVATE orbinaut.c jawz.c duel-bomb.c + broly.c )