Add BUILD_INTERFACE to cfile module

Other modules that depends on it, can reuse includes on linking.
There some files formally not belonging any packages (lib directory), as workaround there temporary include_directories(cfile) on root of project. After migrating all modules this can be removed.
This commit is contained in:
Azamat H. Hackimov 2024-04-21 23:54:02 +03:00
parent 63b4284658
commit 4826c37a69
99 changed files with 127 additions and 99 deletions

View File

@ -10,4 +10,6 @@ set(CPPS
viewport.cpp)
add_library(2dlib STATIC ${HEADERS} ${CPPS})
target_link_libraries(2dlib PRIVATE
cfile
)

View File

@ -120,7 +120,7 @@
#include "renderer.h"
#include "gr.h"
#include "mono.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "bitmap.h"
#include "mem.h"

View File

@ -104,7 +104,12 @@ if(LOGGER)
add_definitions(-DLOGGER)
endif()
include_directories("${CMAKE_SOURCE_DIR}" "lib" "Descent3" ${PLATFORM_INCLUDES})
include_directories(
"cfile" # TODO: Remove after untying all modules
"lib" # TODO: Remove after untying all modules
"Descent3"
${PLATFORM_INCLUDES}
)
# file(GLOB_RECURSE INCS "*.h")

View File

@ -65,7 +65,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "game.h"
#include "mem.h"

View File

@ -95,7 +95,7 @@
#include "ddio.h"
#include "gamefont.h"
#include "multi_ui.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mem.h"
#include "game.h"
#include "stringtable.h"

View File

@ -19,7 +19,7 @@
#include "DllWrappers.h"
#include "pserror.h"
#include "pstring.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"

View File

@ -20,7 +20,7 @@
#define DLLWRAPPERS_H_
#include "pserror.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"

View File

@ -182,7 +182,7 @@
#define __INVENTORY_H__
#include "pstypes.h"
#include "cfile/cfile.h"
#include "cfile.h"
struct object;

View File

@ -1248,7 +1248,7 @@
#include "LoadLevel.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "descent.h"
#include "object.h"

View File

@ -443,7 +443,7 @@
* $NoKeywords: $
*/
#include "cfile/cfile.h"
#include "cfile.h"
#include "room.h"
// Chunk types

View File

@ -640,7 +640,7 @@
#include "3d.h"
#include "LoadLevel.h"
#include "pserror.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "gamefont.h"
#include "grdefs.h"
#include "descent.h"

View File

@ -402,7 +402,7 @@
#include "osiris_dll.h"
#include "pserror.h"
#include "mono.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "ddio.h"
#include "manage.h"
#include <stdlib.h>

View File

@ -63,7 +63,7 @@
#include "bitmap.h"
#include "player.h"
#include "pilot.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mono.h"
#include "ddio.h"
#include "manage.h"

View File

@ -501,7 +501,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include "TelCom.h"
#include "TelComEffects.h"

View File

@ -151,7 +151,7 @@
#include <string.h>
#include <ctype.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"

View File

@ -82,7 +82,7 @@
#include <string.h>
#include <ctype.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"

View File

@ -85,7 +85,7 @@
#include <string.h>
#include <ctype.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "ddio.h"
#include "bitmap.h"

View File

@ -19,7 +19,7 @@
#ifndef _AIAMBIENT_H_
#define _AIAMBIENT_H_
#include "cfile/cfile.h"
#include "cfile.h"
#define MAX_AL_TYPES 6
#define MAX_ALS_PER_TYPE 130

View File

@ -24,7 +24,7 @@
#include "pserror.h"
#include "pstypes.h"
#include "audiotaunts.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "audio_encode.h"
#include "byteswap.h"
#include "mem.h"

View File

@ -43,7 +43,7 @@
#include "list.h"
#include "vecmat.h"
#include "cfile/cfile.h"
#include "cfile.h"
#define BSP_IN_FRONT 1
#define BSP_BEHIND 2

View File

@ -59,7 +59,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>

View File

@ -296,7 +296,7 @@
#include "cinematics.h"
#include "hlsoundlib.h"
#include "terrain.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mem.h"
#include "lighting.h"
#include "PHYSICS.H"

View File

@ -83,7 +83,7 @@
#include "descent.h"
#include <time.h>
#include "mono.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "program.h"
#include <fcntl.h>

View File

@ -112,8 +112,8 @@ typedef int socklen_t;
#include "pstypes.h"
#include "pserror.h"
#include "pstring.h"
#include "cfile/cfile.h"
#include "cfile/inffile.h"
#include "cfile.h"
#include "inffile.h"
#include "dedicated_server.h"
#include "multi.h"
#include "args.h"

View File

@ -266,7 +266,7 @@
*/
#include <stdio.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "objinfo.h"
#include "ship.h"
#include "ui.h"

View File

@ -385,7 +385,7 @@
#include "pserror.h"
#include "grdefs.h"
#include "mono.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "init.h"
#include "game.h"

View File

@ -676,7 +676,7 @@
#include "cinematics.h"
#include "SmallViews.h"
#include "Mission.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "gameloop.h"
#include "cockpit.h"
#include "game2dll.h"

View File

@ -266,7 +266,7 @@
#include "gamesave.h"
#include "descent.h"
#include "newui.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "Mission.h"
#include "gamesequence.h"
#include "gameevent.h"

View File

@ -85,7 +85,7 @@
#define GAMESAVE_H
#include "pstypes.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "object.h"
#include "objinfo.h"

View File

@ -132,7 +132,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>

View File

@ -105,7 +105,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>

View File

@ -20,7 +20,7 @@
#define _LEVELGOAL_H_
#include "object.h"
#include "cfile/cfile.h"
#include "cfile.h"
#if defined(MACOSX)
#include <malloc/malloc.h>
#else

View File

@ -35,7 +35,7 @@
#include <dirent.h>
#define _GNU_SOURCE
#include <fnmatch.h>
#include "cfile/hogfile.h"
#include "hogfile.h"
#endif
#include "SDL.h"

View File

@ -181,7 +181,7 @@
#include "gamesave.h"
#include "descent.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "Mission.h"
#include "gamesequence.h"
#include "gameevent.h"

View File

@ -91,7 +91,7 @@
#include "game.h"
#include "descent.h"
#include "mono.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "localization.h"
#include "mem.h"
#include "ddio.h"

View File

@ -19,7 +19,7 @@
#ifndef _MATCEN_H_
#define _MATCEN_H_
#include "cfile/cfile.h"
#include "cfile.h"
#include "vecmat.h"
#include "matcen_external.h"

View File

@ -113,7 +113,7 @@
#include "pstypes.h"
#include "manage_external.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "networking.h"
#include "descent.h" //for MSN_NAMELEN
#include "byteswap.h"

View File

@ -68,7 +68,7 @@
*/
#include <stdio.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "multi.h"
#include "objinfo.h"
#include "ship.h"

View File

@ -106,7 +106,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include <stdlib.h>
#include <string.h>

View File

@ -116,7 +116,7 @@
#include "object_external_struct.h"
#include "osiris_share.h"
#include "module.h"
#include "cfile/cfile.h"
#include "cfile.h"
extern uint Osiris_game_checksum;

View File

@ -174,7 +174,7 @@
#define __OSIRIS_PREDEF_H_
#include "osiris_dll.h"
#include "cfile/cfile.h"
#include "cfile.h"
// osipf_CallObjectEvent
// Sends an event to an object. Returns true if the default action should

View File

@ -581,7 +581,7 @@
#include "ddio.h"
#include "descent.h"
#include "game.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "application.h"
#include "manage.h"
#include "newui.h"

View File

@ -90,7 +90,7 @@
#include "pstypes.h"
#include "controls.h"
#include "Controller.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "weapon.h"
#include "config.h"

View File

@ -160,7 +160,7 @@
#include "pserror.h"
#include "bitmap.h"
#include "vclip.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mono.h"
#include "ddio.h"
#include "gametexture.h"

View File

@ -356,7 +356,7 @@
#include "sounds.h"
#include "stringtable.h"
#include "Macros.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "AIMain.h"
#include <algorithm>

View File

@ -8,3 +8,6 @@ set(CPPS
tga.cpp)
add_library(bitmap STATIC ${HEADERS} ${CPPS})
target_link_libraries(bitmap PRIVATE
cfile
)

View File

@ -300,7 +300,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "texture.h"
#include "bitmap.h"
#include "pstypes.h"

View File

@ -74,7 +74,7 @@
#include "mem.h"
#include "iff.h"
#include "byteswap.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "pstypes.h"
#include "bitmap.h"

View File

@ -19,7 +19,7 @@
#ifndef _IFF_H
#define _IFF_H
#include "cfile/cfile.h"
#include "cfile.h"
// Error codes for read & write routines

View File

@ -132,7 +132,7 @@
* $NoKeywords: $
*/
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "pstypes.h"
#include "bitmap.h"

View File

@ -1,6 +1,12 @@
set(CPPS
cfile.cpp
hogfile.cpp
inffile.cpp)
cfile.cpp
hogfile.cpp
inffile.cpp
)
add_library(cfile STATIC ${CPPS})
target_include_directories(cfile PUBLIC
$<BUILD_INTERFACE:
${PROJECT_SOURCE_DIR}/cfile
>
)

View File

@ -38,8 +38,8 @@
#include "pserror.h"
#include "ddio.h"
#include "psglob.h"
#include "cfile/cfile.h"
#include "cfile/hogfile.h" //info about library file
#include "cfile.h"
#include "hogfile.h" //info about library file
#include "mem.h"
// Library structures

View File

@ -102,7 +102,7 @@
#include "linux/linux_fix.h"
#endif
#include "byteswap.h"
#include "cfile/hogfile.h"
#include "hogfile.h"
#include "pstypes.h"
#include "Macros.h"
#include "mem.h"

View File

@ -20,9 +20,9 @@
//
//////////////////////////////////////////////////////////////////////
#include "cfile/inffile.h"
#include "inffile.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstring.h"
#include "pserror.h"

View File

@ -108,7 +108,7 @@
#include <linux/soundcard.h>
#include <stdarg.h>
#include <errno.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "mono.h"
#include "soundload.h"

View File

@ -30,7 +30,7 @@
#include <dlfcn.h>
#include <stdarg.h>
#include <errno.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "mono.h"
#include "soundload.h"

View File

@ -16,3 +16,6 @@ set(CPPS
ssl_lib.cpp)
add_library(dd_sndlib STATIC ${HEADERS} ${CPPS})
target_link_libraries(dd_sndlib PRIVATE
cfile
)

View File

@ -211,7 +211,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "mono.h"
#include "soundload.h"

View File

@ -98,7 +98,7 @@
#include "pserror.h"
#include "logfile.h"
#include "Macros.h"
#include "cfile/inffile.h"
#include "inffile.h"
typedef struct tA3D
{

View File

@ -101,7 +101,7 @@
#else
#include <malloc.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "mem.h"
#include "pserror.h"
#include <string.h>

View File

@ -82,7 +82,7 @@
#include "ddio_mac.h"
#include "psglob.h"
#include "mem.h"
#include "cfile/cfile.h"
#include "cfile.h"
// ---------------------------------------------------------------------------
// File Level Globals
// ---------------------------------------------------------------------------

View File

@ -108,7 +108,7 @@
*/
#include "grtextlib.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "bitmap.h"
#include "pserror.h"
#include "renderer.h"

View File

@ -19,7 +19,7 @@
#ifndef PSBITMAP_H
#define PSBITMAP_H
#include "pstypes.h"
#include "cfile/cfile.h"
#include "cfile.h"
#ifdef __LINUX__
#include "linux/linux_fix.h" //needed for stricmp's throughout bitmap lib
#endif

View File

@ -21,7 +21,7 @@
#define MANAGE_H
#include <stdio.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "bitmap.h"
#include "manage_external.h"

View File

@ -2,3 +2,6 @@ set(HEADERS)
set(CPPS lnxcontroller.cpp)
add_library(lnxcontroller STATIC ${HEADERS} ${CPPS})
target_link_libraries(lnxcontroller PRIVATE
cfile
)

View File

@ -47,7 +47,7 @@
#include "ddio.h"
#include "pserror.h"
#include "joystick.h"
#include "cfile/inffile.h"
#include "inffile.h"
// Sorry! This is needed for the semi-hacky mouselook support
#include "descent.h"

View File

@ -8,7 +8,7 @@
#include "appdatabase.h"
#include <string.h>
#include "mem.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "ddio.h"
#include "ddio_mac.h"
#include "descent.h"

View File

@ -32,7 +32,7 @@
#include "descent.h"
#include "ddio.h"
#include "args.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "program.h"
#include <stdlib.h>
#include <memory.h>

View File

@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
// #include <process.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include "mono.h"
#include "soundload.h"

View File

@ -149,7 +149,7 @@
#include <sound.h>
#include "streamaudio.h"
#include "pserror.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mem.h"
#include "Macros.h"
#include "ddio.h"

View File

@ -22,3 +22,6 @@ set(CPPS
weaponpage.cpp)
add_library(manage STATIC ${HEADERS} ${CPPS})
target_link_libraries(manage PRIVATE
cfile
)

View File

@ -147,7 +147,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "door.h"
#include "doorpage.h"

View File

@ -21,7 +21,7 @@
#include "manage.h"
#include "door.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
typedef struct {

View File

@ -20,7 +20,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "mono.h"
#include "pserror.h"

View File

@ -20,7 +20,7 @@
#define GAMEFILEPAGE_H
#include "manage.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
#include "gamefile.h"

View File

@ -355,7 +355,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "genericpage.h"
#include "soundpage.h"

View File

@ -20,7 +20,7 @@
#define GENERICPAGE_H
#include "manage.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
#include "objinfo.h"
#include "robotfirestruct.h"

View File

@ -456,7 +456,7 @@
#include "mono.h"
#include "object.h"
#include "ddio.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "appdatabase.h"
#include "genericpage.h"
#include "mem.h"

View File

@ -64,7 +64,7 @@
#if defined(WIN32)
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "megacell.h"
#include "megapage.h"

View File

@ -21,7 +21,7 @@
#include "manage.h"
#include "megacell.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
typedef struct {

View File

@ -178,7 +178,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "pstypes.h"
#include "pserror.h"

View File

@ -20,7 +20,7 @@
#define POWERPAGE_H
#include "manage.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
#include "powerup.h"

View File

@ -21,7 +21,7 @@
#include "manage.h"
#include "robot.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
#include "objinfo.h"

View File

@ -201,7 +201,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "ship.h"
#include "shippage.h"

View File

@ -21,7 +21,7 @@
#include "manage.h"
#include "ship.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
typedef struct {

View File

@ -120,7 +120,7 @@
#if defined(WIN32)
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "soundpage.h"
#include "mono.h"

View File

@ -21,7 +21,7 @@
#include "manage.h"
#include "soundload.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
typedef struct {

View File

@ -261,7 +261,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "gametexture.h"
#include "bitmap.h"

View File

@ -20,7 +20,7 @@
#define TEXPAGE_H
#include "manage.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
#include "procedurals.h"

View File

@ -290,7 +290,7 @@
#include <windows.h>
#endif
#include "cfile/cfile.h"
#include "cfile.h"
#include "manage.h"
#include "weapon.h"
#include "weaponpage.h"

View File

@ -22,7 +22,7 @@
#include "manage.h"
#include "weapon.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pstypes.h"
typedef struct {

View File

@ -6,3 +6,6 @@ set(CPPS
tracklist.cpp)
add_library(music STATIC ${HEADERS} ${CPPS})
target_link_libraries(music
cfile
)

View File

@ -73,7 +73,7 @@
#include "music.h"
#include "musiclib.h"
#include "cfile/inffile.h"
#include "inffile.h"
#include "mem.h"
#include <string.h>

View File

@ -150,7 +150,7 @@
#include "pserror.h"
#include "ddio.h"
#include "Macros.h"
#include "cfile/inffile.h"
#include "inffile.h"
#include "streamaudio.h"
#include "mem.h"
#include <string.h>

View File

@ -64,7 +64,7 @@
#include "descent.h"
#include "manage.h"
#include "ddio.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include <stdlib.h>
#include <stdio.h>

View File

@ -234,7 +234,7 @@
#include <string.h>
#include "ssl_lib.h"
#include "object.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "ddio.h"
#include "soundload.h"
#include "weapon.h"

View File

@ -51,7 +51,7 @@
*/
#include "streamaudio.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "pserror.h"
#include <string.h>

View File

@ -166,7 +166,7 @@
*/
#include "streamaudio.h"
#include "pserror.h"
#include "cfile/cfile.h"
#include "cfile.h"
#include "mem.h"
#include "Macros.h"
#include "ddio.h"

View File

@ -320,7 +320,7 @@
#include "ddio.h"
#include "joystick.h"
#include "Macros.h"
#include "cfile/inffile.h"
#include "inffile.h"
// Sorry! This is needed for the semi-hacky mouselook support
#include "descent.h"