Add SmartHeap (#83)

* add smartheap

* cmake: bump even further

* this seemed to be necessary but now it isn't? ok

* cmake: force include smrtheap.hpp

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* cmake: force include smrtheap.hpp 2

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* remove compiler defs - unnecessary if force-including anyway

* cmake: use interface for cleaner code

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
This commit is contained in:
MattKC
2023-07-15 23:18:21 -07:00
committed by GitHub
parent f247e10b7e
commit 2ffe227d82
7 changed files with 895 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.0...3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(isle CXX)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
option(ISLE_USE_SMARTHEAP "Build with SmartHeap" ${MSVC})
add_library(lego1 SHARED
LEGO1/act1state.cpp
@@ -177,6 +178,16 @@ add_library(lego1 SHARED
LEGO1/viewmanager.cpp
)
if (ISLE_USE_SMARTHEAP)
add_library(SmartHeap::SmartHeap STATIC IMPORTED)
set_target_properties(SmartHeap::SmartHeap PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/3rdparty/smartheap/SHLW32MT.LIB"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/smartheap"
INTERFACE_COMPILE_OPTIONS "/FI${CMAKE_SOURCE_DIR}/3rdparty/smartheap/SMRTHEAP.HPP")
target_link_libraries(lego1 PRIVATE SmartHeap::SmartHeap)
endif()
# Link libraries
target_link_libraries(lego1 PRIVATE ddraw dsound winmm)
@@ -194,6 +205,10 @@ if (ISLE_BUILD_APP)
# Include LEGO1 headers in ISLE
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
if (ISLE_USE_SMARTHEAP)
target_link_libraries(isle PRIVATE SmartHeap::SmartHeap)
endif()
# Link DSOUND, WINMM, and LEGO1
target_link_libraries(isle PRIVATE dsound winmm lego1)