Go back to using Sourcefiles since make works again.
This commit is contained in:
parent
fca25088c7
commit
ec7e1e7f2c
8 changed files with 18 additions and 373 deletions
|
|
@ -145,6 +145,13 @@ 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.")
|
message(WARNING "Using clang and CCache: You may want to set environment variable CCACHE_CPP2=yes to prevent include errors during compile.")
|
||||||
endif()
|
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
|
# bitness check
|
||||||
set(SRB2_SYSTEM_BITS 0)
|
set(SRB2_SYSTEM_BITS 0)
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
|
|
||||||
|
|
@ -1,133 +1,4 @@
|
||||||
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
|
|
||||||
k_mapuser.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}")
|
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
|
# On MinGW with internal libraries, link the standard library statically
|
||||||
|
|
@ -136,6 +7,10 @@ endif()
|
||||||
|
|
||||||
target_compile_features(SRB2SDL2 PRIVATE c_std_11 cxx_std_17)
|
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_ASM_SOURCES vid_copy.s)
|
||||||
|
|
||||||
set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas)
|
set(SRB2_NASM_SOURCES tmap_mmx.nas tmap.nas)
|
||||||
|
|
|
||||||
|
|
@ -1,183 +1 @@
|
||||||
##-----------------------------------------------------------------------------
|
target_sourcefile(cpp)
|
||||||
##
|
|
||||||
## Copyright (C) 2015-2016 David Hill
|
|
||||||
##
|
|
||||||
## See COPYING for license information.
|
|
||||||
##
|
|
||||||
##-----------------------------------------------------------------------------
|
|
||||||
##
|
|
||||||
## Root CMake file.
|
|
||||||
##
|
|
||||||
##-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6)
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0017 NEW)
|
|
||||||
|
|
||||||
project(acsvm)
|
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
|
|
||||||
|
|
||||||
##----------------------------------------------------------------------------|
|
|
||||||
## Functions |
|
|
||||||
##
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_EXE
|
|
||||||
##
|
|
||||||
function(ACSVM_INSTALL_EXE name)
|
|
||||||
if(ACSVM_INSTALL_EXE)
|
|
||||||
install(TARGETS ${name}
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
ARCHIVE DESTINATION lib
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_LIB
|
|
||||||
##
|
|
||||||
function(ACSVM_INSTALL_LIB name)
|
|
||||||
if(ACSVM_INSTALL_LIB)
|
|
||||||
if(ACSVM_INSTALL_API)
|
|
||||||
install(TARGETS ${name}
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
ARCHIVE DESTINATION lib
|
|
||||||
)
|
|
||||||
elseif(ACSVM_SHARED)
|
|
||||||
install(TARGETS ${name}
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_TRY_C_FLAG
|
|
||||||
##
|
|
||||||
function(ACSVM_TRY_C_FLAG flag name)
|
|
||||||
CHECK_C_COMPILER_FLAG(${flag} ACSVM_C_FLAG_${name})
|
|
||||||
|
|
||||||
if(ACSVM_C_FLAG_${name})
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_TRY_CXX_FLAG
|
|
||||||
##
|
|
||||||
function(ACSVM_TRY_CXX_FLAG flag name)
|
|
||||||
CHECK_CXX_COMPILER_FLAG(${flag} ACSVM_CXX_FLAG_${name})
|
|
||||||
|
|
||||||
if(ACSVM_CXX_FLAG_${name})
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
|
|
||||||
##----------------------------------------------------------------------------|
|
|
||||||
## Environment Detection |
|
|
||||||
##
|
|
||||||
|
|
||||||
set(ACSVM_SHARED_DEFAULT ON)
|
|
||||||
|
|
||||||
if(NOT ACSVM_NOFLAGS)
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
|
||||||
ACSVM_TRY_C_FLAG(-Wall Wall)
|
|
||||||
ACSVM_TRY_C_FLAG(-Wextra Wextra)
|
|
||||||
|
|
||||||
ACSVM_TRY_C_FLAG(-std=c11 STD_C)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
||||||
ACSVM_TRY_CXX_FLAG(-Wall Wall)
|
|
||||||
ACSVM_TRY_CXX_FLAG(-Wextra Wextra)
|
|
||||||
|
|
||||||
ACSVM_TRY_CXX_FLAG(-std=c++11 STD_CXX)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
# Disable shared by default, as the source does not contain the needed
|
|
||||||
# declaration annotations to make that work under MSVC.
|
|
||||||
set(ACSVM_SHARED_DEFAULT OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
##----------------------------------------------------------------------------|
|
|
||||||
## Variables |
|
|
||||||
##
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_API
|
|
||||||
##
|
|
||||||
if(NOT DEFINED ACSVM_INSTALL_API)
|
|
||||||
set(ACSVM_INSTALL_API ON CACHE BOOL "Install ACSVM headers.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_DOC
|
|
||||||
##
|
|
||||||
if(NOT DEFINED ACSVM_INSTALL_DOC)
|
|
||||||
set(ACSVM_INSTALL_DOC ON CACHE BOOL "Install ACSVM documentation.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_EXE
|
|
||||||
##
|
|
||||||
if(NOT DEFINED ACSVM_INSTALL_EXE)
|
|
||||||
set(ACSVM_INSTALL_EXE ON CACHE BOOL "Install ACSVM executables.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_INSTALL_LIB
|
|
||||||
##
|
|
||||||
if(NOT DEFINED ACSVM_INSTALL_LIB)
|
|
||||||
set(ACSVM_INSTALL_LIB ON CACHE BOOL "Install ACSVM libraries.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_SHARED
|
|
||||||
##
|
|
||||||
## If true (or equiavalent), libraries will be built as SHARED. Otherwise,
|
|
||||||
## they are built as STATIC.
|
|
||||||
##
|
|
||||||
if(NOT DEFINED ACSVM_SHARED)
|
|
||||||
set(ACSVM_SHARED ${ACSVM_SHARED_DEFAULT} CACHE BOOL
|
|
||||||
"Build libraries as shared objects.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
##
|
|
||||||
## ACSVM_SHARED_DECL
|
|
||||||
##
|
|
||||||
## Used internally for convenience in add_library commands.
|
|
||||||
##
|
|
||||||
if(ACSVM_SHARED)
|
|
||||||
set(ACSVM_SHARED_DECL SHARED)
|
|
||||||
else()
|
|
||||||
set(ACSVM_SHARED_DECL STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
##----------------------------------------------------------------------------|
|
|
||||||
## Environment Configuration |
|
|
||||||
##
|
|
||||||
|
|
||||||
include_directories(.)
|
|
||||||
|
|
||||||
|
|
||||||
##----------------------------------------------------------------------------|
|
|
||||||
## Targets |
|
|
||||||
##
|
|
||||||
|
|
||||||
add_subdirectory(ACSVM)
|
|
||||||
|
|
||||||
add_subdirectory(Util)
|
|
||||||
|
|
||||||
## EOF
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,2 @@
|
||||||
add_subdirectory(ACSVM)
|
add_subdirectory(ACSVM)
|
||||||
target_sources(SRB2SDL2 PRIVATE
|
target_sourcefile(cpp)
|
||||||
environment.cpp
|
|
||||||
environment.hpp
|
|
||||||
thread.cpp
|
|
||||||
thread.hpp
|
|
||||||
call-funcs.cpp
|
|
||||||
call-funcs.hpp
|
|
||||||
stream.cpp
|
|
||||||
stream.hpp
|
|
||||||
interface.cpp
|
|
||||||
interface.h
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
add_subdirectory(internal)
|
target_sourcefile(c)
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1 @@
|
||||||
target_sources(SRB2SDL2 PRIVATE
|
target_sourcefile(c)
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1 @@
|
||||||
target_sources(SRB2SDL2 PRIVATE
|
target_sourcefile(c)
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
target_sources(SRB2SDL2 PRIVATE
|
target_sourcefile(cpp)
|
||||||
loops.cpp
|
|
||||||
)
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue