diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c2f8e4b2..3b954087e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,13 +145,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 f3ee5a215..782a30106 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,132 @@ -add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32) +add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 + comptime.c + md5.c + config.h.in + qs22j.c + 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_menu.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_loop.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 + r_bbox.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 + lua_followerlib.c + k_kart.c + k_collide.c + k_color.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_terrain.c + k_brightmap.c + k_director.c + k_follower.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 +135,6 @@ endif() target_compile_features(SRB2SDL2 PRIVATE c_std_11 cxx_std_17) -# 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) @@ -27,6 +151,7 @@ set(SRB2_CONFIG_SKIP_COMPTIME OFF CACHE BOOL add_subdirectory(blua) add_subdirectory(blan) +add_subdirectory(objects) # OS macros if (UNIX) @@ -372,7 +497,6 @@ if(SRB2_CONFIG_PROFILEMODE AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") endif() add_subdirectory(sdl) -add_subdirectory(objects) # strip debug symbols into separate file when using gcc. # to be consistent with Makefile, don't generate for OS X. diff --git a/src/blan/CMakeLists.txt b/src/blan/CMakeLists.txt index 4e9c67d2f..941949555 100644 --- a/src/blan/CMakeLists.txt +++ b/src/blan/CMakeLists.txt @@ -1 +1 @@ -target_sourcefile(c) +add_subdirectory(internal) \ No newline at end of file diff --git a/src/blan/internal/CMakeLists.txt b/src/blan/internal/CMakeLists.txt new file mode 100644 index 000000000..3242a16be --- /dev/null +++ b/src/blan/internal/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(SRB2SDL2 PRIVATE + b_soc.c +) diff --git a/src/blua/CMakeLists.txt b/src/blua/CMakeLists.txt index 4e9c67d2f..ff5d8fba9 100644 --- a/src/blua/CMakeLists.txt +++ b/src/blua/CMakeLists.txt @@ -1 +1,29 @@ -target_sourcefile(c) +target_sources(SRB2SDL2 PRIVATE + lapi.c + lbaselib.c + ldo.c + ldblib.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 + loslib.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..266fef835 100644 --- a/src/objects/CMakeLists.txt +++ b/src/objects/CMakeLists.txt @@ -1 +1,3 @@ -target_sourcefile(c) +target_sources(SRB2SDL2 PRIVATE + loops.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