Make mem module isolated from project

Properly define MEM_USE_RTL definition only for mem library. Link other dependant modules with mem.
This commit is contained in:
Azamat H. Hackimov 2024-06-20 00:31:58 +03:00
parent fa3f379e41
commit db8aa64d2f
20 changed files with 39 additions and 14 deletions

View File

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

View File

@ -149,8 +149,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_options("/MP") # so msbuild builds with multiple processes
endif()
add_compile_definitions($<$<BOOL:${ENABLE_MEM_RTL}>:MEM_USE_RTL>)
add_compile_definitions($<$<CONFIG:Release>:RELEASE>)
add_compile_definitions($<$<CONFIG:Debug>:_DEBUG>)

View File

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

View File

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

View File

@ -18,3 +18,6 @@ target_include_directories(ddebug PUBLIC
>
PRIVATE ${PROJECT_BINARY_DIR}/lib # For d3_version.h
)
target_link_libraries(ddebug PRIVATE
mem
)

View File

@ -24,8 +24,9 @@ set(CPPS
>
)
add_library(ddio STATIC ${CPPS})
target_link_libraries(ddio
target_link_libraries(ddio PRIVATE
ddebug
mem
)
target_include_directories(ddio PUBLIC
$<BUILD_INTERFACE:

View File

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

View File

@ -25,6 +25,7 @@ add_library(manage STATIC ${HEADERS} ${CPPS})
target_link_libraries(manage PRIVATE
cfile
ddio
mem
sndlib
stream_audio
)

View File

@ -1,5 +1,13 @@
set(HEADERS)
set(CPPS
mem.cpp)
mem.cpp
)
add_library(mem STATIC ${HEADERS} ${CPPS})
add_library(mem STATIC ${CPPS})
target_compile_definitions(mem PUBLIC
$<$<BOOL:${ENABLE_MEM_RTL}>:MEM_USE_RTL>
)
target_include_directories(mem PUBLIC
$<BUILD_INTERFACE:
${PROJECT_SOURCE_DIR}/mem
>
)

View File

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

View File

@ -6,4 +6,5 @@ add_library(movie STATIC ${HEADERS} ${CPPS})
target_link_libraries(movie PRIVATE
ddio
libmve
mem
)

View File

@ -9,6 +9,7 @@ add_library(music STATIC ${HEADERS} ${CPPS})
target_link_libraries(music
cfile
ddio
mem
sndlib
stream_audio
)

View File

@ -6,3 +6,6 @@ set(CPPS
inetgetfile.cpp)
add_library(inetfile STATIC ${HEADERS} ${CPPS})
target_link_libraries(inetfile PRIVATE
mem
)

View File

@ -1,14 +1,13 @@
set(HEADERS)
set(CPPS
networking.cpp)
networking.cpp
$<$<PLATFORM_ID:Windows>:
directplay.cpp
>
)
set(PLATFORMCPPS)
if(WIN32)
set(PLATFORMCPPS "directplay.cpp")
endif()
add_library(networking STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS})
add_library(networking STATIC ${HEADERS} ${CPPS})
target_link_libraries(networking PRIVATE
ddio
mem
)

View File

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

View File

@ -27,4 +27,5 @@ add_library(renderer STATIC ${HEADERS} ${CPPS})
target_link_libraries(renderer PRIVATE
bitmap
ddio
mem
)

View File

@ -21,6 +21,7 @@ add_library(sndlib STATIC ${CPPS})
target_link_libraries(sndlib PRIVATE
cfile
ddio
mem
stream_audio
)
target_include_directories(sndlib PUBLIC

View File

@ -7,6 +7,7 @@ add_library(stream_audio STATIC ${HEADERS} ${CPPS})
target_link_libraries(stream_audio PRIVATE
ddio
libacm
mem
sndlib
)
target_include_directories(stream_audio PUBLIC

View File

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