Isolate misc module

Isolate misc module for better dependency handling.
This commit is contained in:
Azamat H. Hackimov 2024-06-27 00:09:50 +03:00
parent 1ed931ff60
commit 59487976f6
48 changed files with 102 additions and 22 deletions

View File

@ -13,4 +13,5 @@ add_library(2dlib STATIC ${HEADERS} ${CPPS})
target_link_libraries(2dlib PRIVATE
cfile
mem
misc
)

View File

@ -37,14 +37,12 @@
#include "args.h"
#include "init.h"
#include "ddio.h"
#include "osiris_dll.h"
#include "loki_utils.h"
#include "log.h"
extern bool ddio_mouseGrabbed;
int no_debug_dialog = 0;
const char *DMFCGetString(int d);
// void *x = (void *) DMFCGetString; // just force a reference to dmfc.so ...

View File

@ -109,7 +109,6 @@ static int m_resource_language = 0;
#define VENDOR_NEXGEN 5
#define VENDOR_UNKNOWN 6
int no_debug_dialog = 0;
// ---------------------------------------------------------------------------
// Define our operating system specific extensions to the gameos system

View File

@ -16,6 +16,7 @@ target_link_libraries(bitmap PRIVATE
ddebug
ddio
mem
misc
stb
)
target_include_directories(bitmap PUBLIC

View File

@ -8,6 +8,7 @@ add_library(cfile STATIC ${CPPS})
target_link_libraries(cfile PRIVATE
ddio
mem
misc
)
target_include_directories(cfile PUBLIC
$<BUILD_INTERFACE:

View File

@ -6,3 +6,6 @@ set(CPPS
HuffmanBasic.cpp)
add_library(czip STATIC ${HEADERS} ${CPPS})
target_link_libraries(czip PRIVATE
misc
)

View File

@ -9,3 +9,6 @@ set(CPPS
ddgrWin32Init.cpp)
add_library(dd_grwin32 STATIC ${HEADERS} ${CPPS})
target_link_libraries(dd_grwin32 PRIVATE
misc
)

View File

@ -14,4 +14,7 @@ target_link_libraries(dd_video PRIVATE
$<$<PLATFORM_ID:Linux,Darwin>:
linux
>
$<$<PLATFORM_ID:Windows>:
misc
>
)

View File

@ -20,4 +20,7 @@ target_include_directories(ddebug PUBLIC
)
target_link_libraries(ddebug PRIVATE
mem
$<$<PLATFORM_ID:Windows>:
misc
>
)

View File

@ -197,6 +197,7 @@
#include "debug.h"
#include "mem.h"
#include "mono.h"
#include "pserror.h"
///////////////////////////////////////////////////////////////////////////////
@ -1152,8 +1153,6 @@ const int NumCodeBytes = 16; // Number of code bytes to record.
const int MaxStackDump = 2048; // Maximum number of DWORDS in stack dumps.
const int StackColumns = 8; // Number of columns in stack dump.
extern int no_debug_dialog;
int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message) {
static int BeenHere;
if (BeenHere) // Going recursive! That must mean this routine crashed!

View File

@ -26,6 +26,7 @@ add_library(ddio STATIC ${CPPS})
target_link_libraries(ddio PRIVATE
ddebug
mem
misc
)
target_include_directories(ddio PUBLIC
$<BUILD_INTERFACE:

View File

@ -8,4 +8,5 @@ add_library(grtext STATIC ${HEADERS} ${CPPS})
target_link_libraries(grtext PRIVATE
ddio
mem
misc
)

View File

@ -19,4 +19,5 @@ target_include_directories(linux PUBLIC
)
target_link_libraries(linux PRIVATE
ddio
misc
)

View File

@ -26,6 +26,7 @@ target_link_libraries(manage PRIVATE
cfile
ddio
mem
misc
sndlib
stream_audio
)

View File

@ -6,6 +6,9 @@ add_library(mem STATIC ${CPPS})
target_compile_definitions(mem PUBLIC
$<$<BOOL:${ENABLE_MEM_RTL}>:MEM_USE_RTL>
)
target_link_libraries(mem PRIVATE
misc
)
target_include_directories(mem PUBLIC
$<BUILD_INTERFACE:
${PROJECT_SOURCE_DIR}/mem

View File

@ -1,15 +1,25 @@
set(HEADERS)
set(CPPS
error.cpp
logfile.cpp
log.cpp
psglob.cpp
psrand.cpp
pstring.cpp)
pstring.cpp
)
add_library(misc STATIC ${HEADERS} ${CPPS})
target_link_libraries(misc ddebug)
add_library(misc STATIC ${CPPS})
target_link_libraries(misc PRIVATE
ddebug
# For SDL_Assert()
$<$<PLATFORM_ID:Darwin,Linux>:
SDL2::SDL2
>
)
target_include_directories(misc PUBLIC
$<BUILD_INTERFACE:
${PROJECT_SOURCE_DIR}/misc
>
)
if(BUILD_TESTING)
add_subdirectory(tests)

View File

@ -114,7 +114,7 @@ bool error_Init(bool debugger, bool mono_debug, const char *app_title) {
return true;
}
extern int no_debug_dialog;
int no_debug_dialog = 0;
// exits the application and prints out a standard error message
void Error(const char *fmt, ...) {

View File

@ -151,6 +151,9 @@
#include <assert.h>
#include "debug.h"
#include "mono.h"
extern int no_debug_dialog;
// initializes error handler.
bool error_Init(bool debugger, bool mono_debug, const char *app_title);
// exits the application and prints out a standard error message

View File

@ -7,4 +7,5 @@ add_library(model STATIC ${HEADERS} ${CPPS})
target_link_libraries(model PRIVATE
ddio
mem
misc
)

View File

@ -5,4 +5,5 @@ set(CPPS
add_library(module STATIC ${HEADERS} ${CPPS})
target_link_libraries(module PRIVATE
ddio
misc
)

View File

@ -7,4 +7,5 @@ target_link_libraries(movie PRIVATE
ddio
libmve
mem
misc
)

View File

@ -10,6 +10,7 @@ target_link_libraries(music
cfile
ddio
mem
misc
sndlib
stream_audio
)

View File

@ -7,6 +7,7 @@ set_target_properties(Direct_TCP_IP PROPERTIES OUTPUT_NAME "Direct TCP~IP")
target_link_libraries(Direct_TCP_IP PRIVATE
ddio
inetfile
misc
$<$<PLATFORM_ID:Windows>:ws2_32>
)

View File

@ -13,6 +13,7 @@ set_target_properties(Parallax_Online PROPERTIES OUTPUT_NAME "Parallax Online")
target_link_libraries(Parallax_Online PRIVATE
ddio
inetfile
misc
$<$<PLATFORM_ID:Windows>:ws2_32>
)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -28,3 +28,6 @@ set(CPPS
add_definitions(-DOUTRAGE_VERSION)
add_library(dmfc STATIC ${HEADERS} ${CPPS})
target_link_libraries(dmfc PRIVATE
misc
)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -8,5 +8,8 @@ set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
target_link_libraries(${NETGAME_MODULE} dmfc)
target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
misc
)
install(TARGETS "${NETGAME_MODULE}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/netgames)

View File

@ -10,4 +10,5 @@ add_library(networking STATIC ${HEADERS} ${CPPS})
target_link_libraries(networking PRIVATE
ddio
mem
misc
)

View File

@ -9,5 +9,6 @@ add_library(physics STATIC ${HEADERS} ${CPPS})
target_link_libraries(physics PRIVATE
ddio
mem
misc
sndlib
)

View File

@ -28,4 +28,5 @@ target_link_libraries(renderer PRIVATE
bitmap
ddio
mem
misc
)

View File

@ -70,7 +70,10 @@ set(SCRIPTS
foreach(SCRIPT ${SCRIPTS})
add_library(${SCRIPT} MODULE ${CPPS} "${SCRIPT}.cpp")
target_link_libraries(${SCRIPT} fix)
target_link_libraries(${SCRIPT}
fix
misc
)
set_target_properties(${SCRIPT} PROPERTIES PREFIX "")
set_target_properties(${SCRIPT} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

View File

@ -22,6 +22,7 @@ target_link_libraries(sndlib PRIVATE
cfile
ddio
mem
misc
stream_audio
)
target_include_directories(sndlib PUBLIC

View File

@ -8,6 +8,7 @@ target_link_libraries(stream_audio PRIVATE
ddio
libacm
mem
misc
sndlib
)
target_include_directories(stream_audio PUBLIC

View File

@ -20,4 +20,5 @@ add_library(ui STATIC ${HEADERS} ${CPPS})
target_link_libraries(ui PRIVATE
ddio
mem
misc
)

View File

@ -3,4 +3,7 @@ set(CPPS
vector.cpp)
add_library(vecmat STATIC ${HEADERS} ${CPPS})
target_link_libraries(vecmat fix)
target_link_libraries(vecmat PRIVATE
fix
misc
)

View File

@ -11,4 +11,5 @@ add_dependencies(win32 get_git_hash)
target_include_directories(win32 PRIVATE ${PROJECT_BINARY_DIR}/lib)
target_link_libraries(win32 PRIVATE
ddio
misc
)