Skip to content

Commit

Permalink
Make mem module isolated from project
Browse files Browse the repository at this point in the history
Properly define MEM_USE_RTL definition only for mem library. Link other dependant modules with mem.
  • Loading branch information
winterheart committed Jun 19, 2024
1 parent fa3f379 commit db8aa64
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 14 deletions.
1 change: 1 addition & 0 deletions 2dlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ set(CPPS
add_library(2dlib STATIC ${HEADERS} ${CPPS})
target_link_libraries(2dlib PRIVATE
cfile
mem
)
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>)

Expand Down
1 change: 1 addition & 0 deletions bitmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ target_link_libraries(bitmap PRIVATE
cfile
ddebug
ddio
mem
stb
)
target_include_directories(bitmap PUBLIC
Expand Down
1 change: 1 addition & 0 deletions cfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions ddebug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ target_include_directories(ddebug PUBLIC
>
PRIVATE ${PROJECT_BINARY_DIR}/lib # For d3_version.h
)
target_link_libraries(ddebug PRIVATE
mem
)
3 changes: 2 additions & 1 deletion ddio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions grtext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ set(CPPS
add_library(grtext STATIC ${HEADERS} ${CPPS})
target_link_libraries(grtext PRIVATE
ddio
mem
)
1 change: 1 addition & 0 deletions manage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_library(manage STATIC ${HEADERS} ${CPPS})
target_link_libraries(manage PRIVATE
cfile
ddio
mem
sndlib
stream_audio
)
14 changes: 11 additions & 3 deletions mem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
>
)
File renamed without changes.
1 change: 1 addition & 0 deletions model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ set(CPPS
add_library(model STATIC ${HEADERS} ${CPPS})
target_link_libraries(model PRIVATE
ddio
mem
)
1 change: 1 addition & 0 deletions movie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ add_library(movie STATIC ${HEADERS} ${CPPS})
target_link_libraries(movie PRIVATE
ddio
libmve
mem
)
1 change: 1 addition & 0 deletions music/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_library(music STATIC ${HEADERS} ${CPPS})
target_link_libraries(music
cfile
ddio
mem
sndlib
stream_audio
)
Expand Down
3 changes: 3 additions & 0 deletions netcon/inetfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ set(CPPS
inetgetfile.cpp)

add_library(inetfile STATIC ${HEADERS} ${CPPS})
target_link_libraries(inetfile PRIVATE
mem
)
15 changes: 7 additions & 8 deletions networking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
set(HEADERS)
set(CPPS
networking.cpp)

set(PLATFORMCPPS)

if(WIN32)
set(PLATFORMCPPS "directplay.cpp")
endif()
networking.cpp
$<$<PLATFORM_ID:Windows>:
directplay.cpp
>
)

add_library(networking STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS})
add_library(networking STATIC ${HEADERS} ${CPPS})
target_link_libraries(networking PRIVATE
ddio
mem
)
1 change: 1 addition & 0 deletions physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ set(CPPS
add_library(physics STATIC ${HEADERS} ${CPPS})
target_link_libraries(physics PRIVATE
ddio
mem
sndlib
)
1 change: 1 addition & 0 deletions renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ add_library(renderer STATIC ${HEADERS} ${CPPS})
target_link_libraries(renderer PRIVATE
bitmap
ddio
mem
)
1 change: 1 addition & 0 deletions sndlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_library(sndlib STATIC ${CPPS})
target_link_libraries(sndlib PRIVATE
cfile
ddio
mem
stream_audio
)
target_include_directories(sndlib PUBLIC
Expand Down
1 change: 1 addition & 0 deletions stream_audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ set(CPPS
add_library(ui STATIC ${HEADERS} ${CPPS})
target_link_libraries(ui PRIVATE
ddio
mem
)

0 comments on commit db8aa64

Please sign in to comment.