2024-06-24 10:25:51 -04:00
|
|
|
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
|
2024-02-07 06:11:45 -05:00
|
|
|
|
|
|
|
# MSVC runtime library flags are selected by an abstraction
|
|
|
|
cmake_policy(SET CMP0091 NEW)
|
2023-06-29 19:39:02 -04:00
|
|
|
|
2024-05-31 14:04:00 -04:00
|
|
|
# To set BUILD_* variables for iniparser below. Is there another way?
|
|
|
|
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
|
|
|
|
2024-05-16 22:11:33 -04:00
|
|
|
project(isle CXX C)
|
2023-06-29 19:39:02 -04:00
|
|
|
|
2024-06-24 10:25:51 -04:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
|
|
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" CACHE PATH "Directory where to put executables and dll")
|
|
|
|
|
2024-05-30 14:41:20 -04:00
|
|
|
# By configuring CMake with -DDOWNLOAD_DEPENDENCIES=ON/OFF,
|
|
|
|
# users can choose between downloading dependencies or using system libraries
|
|
|
|
option(DOWNLOAD_DEPENDENCIES "Download dependencies" TRUE)
|
|
|
|
|
|
|
|
if(DOWNLOAD_DEPENDENCIES)
|
|
|
|
# FetchContent downloads and configures dependencies
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
SDL3
|
|
|
|
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
|
|
|
|
GIT_TAG "main"
|
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(SDL3)
|
2024-05-31 14:04:00 -04:00
|
|
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
iniparser
|
|
|
|
GIT_REPOSITORY "https://github.com/ndevilla/iniparser.git"
|
|
|
|
GIT_TAG "main"
|
|
|
|
EXCLUDE_FROM_ALL
|
|
|
|
)
|
|
|
|
set(BUILD_DOCS off)
|
|
|
|
set(BUILD_SHARED_LIBS off)
|
|
|
|
FetchContent_MakeAvailable(iniparser)
|
2024-05-30 14:41:20 -04:00
|
|
|
else()
|
|
|
|
# find_package looks for already-installed system packages.
|
|
|
|
# Configure with `-DCMAKE_PREFIX_PATH="/path/to/package1;/path/to/package2"`
|
|
|
|
# to add search paths.
|
|
|
|
find_package(SDL3 CONFIG REQUIRED)
|
2024-05-31 14:04:00 -04:00
|
|
|
|
2024-06-25 21:47:43 -04:00
|
|
|
find_package(iniparser CONFIG COMPONENTS static)
|
|
|
|
if(NOT TARGET iniparser-static)
|
|
|
|
find_package(iniparser REQUIRED MODULE COMPONENTS static)
|
|
|
|
endif()
|
2024-05-30 14:41:20 -04:00
|
|
|
endif()
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
include(CMakeDependentOption)
|
|
|
|
include(CMakePushCheckState)
|
|
|
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
|
|
option(ENABLE_CLANG_TIDY "Enable clang-tidy")
|
|
|
|
if (ENABLE_CLANG_TIDY)
|
|
|
|
find_program(CLANG_TIDY_BIN NAMES "clang-tidy")
|
|
|
|
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_BIN}")
|
|
|
|
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_BIN}")
|
|
|
|
endif()
|
|
|
|
|
2024-01-10 17:34:32 -05:00
|
|
|
set(MSVC_FOR_DECOMP FALSE)
|
|
|
|
if (MSVC)
|
|
|
|
# Visual C++ 4.2 -> cl version 10.2.0
|
|
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0")
|
|
|
|
set(MSVC_FOR_DECOMP TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
set(lego1_targets)
|
|
|
|
macro(register_lego1_target __target)
|
|
|
|
list(APPEND lego1_targets ${__target})
|
|
|
|
endmacro()
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
function(add_cxx_warning WARNING)
|
|
|
|
if(ISLE_WERROR)
|
|
|
|
set(compiler_option "-Werror=${WARNING}")
|
|
|
|
else()
|
|
|
|
set(compiler_option "-W${WARNING}")
|
|
|
|
endif()
|
|
|
|
string(MAKE_C_IDENTIFIER "COMPILER_SUPPORTS${compiler_option}" varname)
|
|
|
|
|
|
|
|
cmake_push_check_state(RESET)
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "${compiler_option} ")
|
|
|
|
if(MSVC)
|
|
|
|
string(APPEND CMAKE_REQUIRED_FLAGS "/WX")
|
|
|
|
else()
|
|
|
|
string(APPEND CMAKE_REQUIRED_FLAGS "-Werror")
|
|
|
|
endif()
|
|
|
|
check_cxx_source_compiles("int main() { return 0; }" ${varname})
|
|
|
|
cmake_pop_check_state()
|
|
|
|
|
|
|
|
if(${varname})
|
|
|
|
add_compile_options(${compiler_option})
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
2024-06-24 10:25:51 -04:00
|
|
|
if(NOT MINGW)
|
|
|
|
set(NOT_MINGW TRUE)
|
|
|
|
else()
|
|
|
|
set(NOT_MINGW FALSE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(3rdparty EXCLUDE_FROM_ALL SYSTEM)
|
|
|
|
|
2024-01-10 17:34:32 -05:00
|
|
|
message(STATUS "MSVC for decompilation: ${MSVC_FOR_DECOMP}")
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
option(ISLE_WERROR "Treat warnings as errors" OFF)
|
2023-06-29 19:39:02 -04:00
|
|
|
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
|
2024-02-07 06:11:45 -05:00
|
|
|
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF)
|
2024-06-24 10:25:51 -04:00
|
|
|
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ${NOT_MINGW})
|
|
|
|
cmake_dependent_option(ISLE_D3DRM_FROM_WINE "Use d3drm from wine" "${MINGW}" "NOT ISLE_USE_DX5" OFF)
|
2024-07-16 22:23:10 -04:00
|
|
|
option(ISLE_DECOMP_ASSERT "Assert struct size" ${MSVC_FOR_DECOMP})
|
2024-06-24 10:25:51 -04:00
|
|
|
|
|
|
|
message(STATUS "Using internal DirectX5 SDK: ${ISLE_USE_DX5}")
|
|
|
|
message(STATUS "Using d3drm from wine: ${ISLE_D3DRM_FROM_WINE}")
|
2024-02-01 15:42:10 -05:00
|
|
|
|
|
|
|
add_cxx_warning(parentheses)
|
2023-06-30 14:34:39 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
add_library(DirectX5::DirectX5 INTERFACE IMPORTED)
|
|
|
|
target_include_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/inc")
|
2024-06-25 21:47:43 -04:00
|
|
|
target_link_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib")
|
2024-01-24 21:16:29 -05:00
|
|
|
|
2024-06-25 21:47:43 -04:00
|
|
|
add_subdirectory(3rdparty/d3drm EXCLUDE_FROM_ALL)
|
2024-06-24 10:25:51 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
add_library(Vec::Vec INTERFACE IMPORTED)
|
|
|
|
target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec")
|
|
|
|
|
2024-06-16 09:26:04 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
add_library(tglrl STATIC
|
|
|
|
LEGO1/tgl/d3drm/camera.cpp
|
|
|
|
LEGO1/tgl/d3drm/device.cpp
|
|
|
|
LEGO1/tgl/d3drm/group.cpp
|
|
|
|
LEGO1/tgl/d3drm/light.cpp
|
|
|
|
LEGO1/tgl/d3drm/mesh.cpp
|
2024-03-08 11:55:25 -05:00
|
|
|
LEGO1/tgl/d3drm/meshbuilder.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/tgl/d3drm/renderer.cpp
|
|
|
|
LEGO1/tgl/d3drm/texture.cpp
|
|
|
|
LEGO1/tgl/d3drm/view.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(tglrl)
|
|
|
|
set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
2024-06-24 10:25:51 -04:00
|
|
|
if(ISLE_D3DRM_FROM_WINE)
|
|
|
|
target_link_libraries(tglrl PRIVATE d3drm-wine)
|
|
|
|
else()
|
|
|
|
target_link_libraries(tglrl PRIVATE d3drm)
|
|
|
|
endif()
|
2024-01-24 21:16:29 -05:00
|
|
|
|
|
|
|
add_library(realtime STATIC
|
|
|
|
LEGO1/realtime/matrix.cpp
|
|
|
|
LEGO1/realtime/orientableroi.cpp
|
|
|
|
LEGO1/realtime/realtime.cpp
|
|
|
|
LEGO1/realtime/realtimeview.cpp
|
|
|
|
LEGO1/realtime/vector.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(realtime)
|
|
|
|
set_property(TARGET realtime PROPERTY ARCHIVE_OUTPUT_NAME "realtime$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(realtime PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(realtime PRIVATE Vec::Vec)
|
|
|
|
|
|
|
|
add_library(viewmanager STATIC
|
2024-03-04 16:57:35 -05:00
|
|
|
LEGO1/viewmanager/viewlod.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/viewmanager/viewlodlist.cpp
|
|
|
|
LEGO1/viewmanager/viewmanager.cpp
|
|
|
|
LEGO1/viewmanager/viewroi.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(viewmanager)
|
|
|
|
set_property(TARGET viewmanager PROPERTY ARCHIVE_OUTPUT_NAME "viewmanager$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(viewmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(viewmanager PRIVATE Vec::Vec)
|
|
|
|
|
|
|
|
add_library(mxdirectx STATIC
|
|
|
|
LEGO1/mxdirectx/mxdirect3d.cpp
|
|
|
|
LEGO1/mxdirectx/mxdirectdraw.cpp
|
2024-06-27 15:22:13 -04:00
|
|
|
LEGO1/mxdirectx/mxdirectxinfo.cpp
|
2024-07-08 17:52:50 -04:00
|
|
|
LEGO1/mxdirectx/legodxinfo.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
)
|
|
|
|
register_lego1_target(mxdirectx)
|
|
|
|
set_property(TARGET mxdirectx PROPERTY ARCHIVE_OUTPUT_NAME "MxDirectX$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(mxdirectx PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(mxdirectx PRIVATE ddraw)
|
|
|
|
|
|
|
|
add_library(roi STATIC
|
2024-03-07 14:57:17 -05:00
|
|
|
LEGO1/lego/sources/roi/legolod.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/lego/sources/roi/legoroi.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(roi)
|
|
|
|
set_property(TARGET roi PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$<CONFIG:Debug>:d>")
|
2024-03-05 12:38:53 -05:00
|
|
|
target_include_directories(roi PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(roi PRIVATE viewmanager Vec::Vec)
|
|
|
|
|
|
|
|
add_library(geom STATIC
|
|
|
|
LEGO1/lego/sources/geom/legobox.cpp
|
2024-04-09 05:25:24 -04:00
|
|
|
LEGO1/lego/sources/geom/legoedge.cpp
|
2024-03-07 14:57:17 -05:00
|
|
|
LEGO1/lego/sources/geom/legomesh.cpp
|
2024-03-05 12:38:53 -05:00
|
|
|
LEGO1/lego/sources/geom/legosphere.cpp
|
2024-04-11 07:35:15 -04:00
|
|
|
LEGO1/lego/sources/geom/legounkown100db7f4.cpp
|
2024-03-05 12:38:53 -05:00
|
|
|
LEGO1/lego/sources/geom/legovertex.cpp
|
2024-03-26 13:51:52 -04:00
|
|
|
LEGO1/lego/sources/geom/legoweedge.cpp
|
|
|
|
LEGO1/lego/sources/geom/legowegedge.cpp
|
2024-03-05 12:38:53 -05:00
|
|
|
)
|
|
|
|
register_lego1_target(geom)
|
|
|
|
set_property(TARGET geom PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(geom PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(geom PRIVATE)
|
2024-01-24 21:16:29 -05:00
|
|
|
|
2024-02-18 12:43:42 -05:00
|
|
|
add_library(anim STATIC
|
|
|
|
LEGO1/lego/sources/anim/legoanim.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(anim)
|
|
|
|
set_property(TARGET anim PROPERTY ARCHIVE_OUTPUT_NAME "anim$<$<CONFIG:Debug>:d>")
|
2024-02-23 10:06:16 -05:00
|
|
|
target_include_directories(anim PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
|
2024-02-18 12:43:42 -05:00
|
|
|
target_link_libraries(anim PRIVATE)
|
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
add_library(misc STATIC
|
2024-03-07 14:57:17 -05:00
|
|
|
LEGO1/lego/sources/misc/legocolor.cpp
|
2024-02-23 10:06:16 -05:00
|
|
|
LEGO1/lego/sources/misc/legocontainer.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/lego/sources/misc/legoimage.cpp
|
|
|
|
LEGO1/lego/sources/misc/legostorage.cpp
|
|
|
|
LEGO1/lego/sources/misc/legotexture.cpp
|
2024-01-28 11:45:49 -05:00
|
|
|
LEGO1/lego/sources/misc/legotree.cpp
|
2024-04-07 08:36:58 -04:00
|
|
|
LEGO1/lego/sources/misc/legounknown.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
)
|
|
|
|
register_lego1_target(misc)
|
|
|
|
set_property(TARGET misc PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$<CONFIG:Debug>:d>")
|
2024-02-23 12:54:45 -05:00
|
|
|
target_include_directories(misc PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util")
|
2024-01-24 21:16:29 -05:00
|
|
|
target_link_libraries(misc PRIVATE)
|
|
|
|
|
|
|
|
add_library(3dmanager STATIC
|
|
|
|
LEGO1/lego/sources/3dmanager/lego3dmanager.cpp
|
|
|
|
LEGO1/lego/sources/3dmanager/lego3dview.cpp
|
|
|
|
LEGO1/lego/sources/3dmanager/legoview1.cpp
|
|
|
|
LEGO1/lego/sources/3dmanager/tglsurface.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(3dmanager)
|
|
|
|
set_property(TARGET 3dmanager PROPERTY ARCHIVE_OUTPUT_NAME "3dmanager$<$<CONFIG:Debug>:d>")
|
|
|
|
target_include_directories(3dmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_link_libraries(3dmanager PRIVATE Vec::Vec)
|
|
|
|
|
|
|
|
add_library(omni STATIC
|
|
|
|
LEGO1/omni/src/action/mxdsaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsanim.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsevent.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsmediaaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsmultiaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsobjectaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsobject.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsparallelaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsselectaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsserialaction.cpp
|
|
|
|
LEGO1/omni/src/action/mxdssound.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsstill.cpp
|
|
|
|
LEGO1/omni/src/action/mxdsstreamingaction.cpp
|
|
|
|
LEGO1/omni/src/audio/mxaudiomanager.cpp
|
|
|
|
LEGO1/omni/src/audio/mxaudiopresenter.cpp
|
|
|
|
LEGO1/omni/src/audio/mxsoundmanager.cpp
|
|
|
|
LEGO1/omni/src/audio/mxsoundpresenter.cpp
|
|
|
|
LEGO1/omni/src/audio/mxwavepresenter.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/omni/src/common/mxatom.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/common/mxcompositepresenter.cpp
|
|
|
|
LEGO1/omni/src/common/mxcore.cpp
|
2024-07-02 13:46:40 -04:00
|
|
|
LEGO1/omni/src/common/mxdebug.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/common/mxmediamanager.cpp
|
|
|
|
LEGO1/omni/src/common/mxmediapresenter.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/omni/src/common/mxmisc.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/common/mxobjectfactory.cpp
|
|
|
|
LEGO1/omni/src/common/mxpresenter.cpp
|
|
|
|
LEGO1/omni/src/common/mxstring.cpp
|
|
|
|
LEGO1/omni/src/common/mxticklemanager.cpp
|
|
|
|
LEGO1/omni/src/common/mxtimer.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/omni/src/common/mxutilities.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/common/mxvariable.cpp
|
|
|
|
LEGO1/omni/src/common/mxvariabletable.cpp
|
|
|
|
LEGO1/omni/src/entity/mxentity.cpp
|
|
|
|
LEGO1/omni/src/event/mxeventmanager.cpp
|
|
|
|
LEGO1/omni/src/event/mxeventpresenter.cpp
|
|
|
|
LEGO1/omni/src/main/mxomni.cpp
|
|
|
|
LEGO1/omni/src/main/mxomnicreateflags.cpp
|
|
|
|
LEGO1/omni/src/main/mxomnicreateparam.cpp
|
|
|
|
LEGO1/omni/src/notify/mxactionnotificationparam.cpp
|
|
|
|
LEGO1/omni/src/notify/mxnotificationmanager.cpp
|
|
|
|
LEGO1/omni/src/notify/mxnotificationparam.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdiskstreamcontroller.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdiskstreamprovider.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdsbuffer.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdschunk.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdsfile.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdssource.cpp
|
|
|
|
LEGO1/omni/src/stream/mxdssubscriber.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/omni/src/stream/mxio.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/stream/mxramstreamcontroller.cpp
|
|
|
|
LEGO1/omni/src/stream/mxramstreamprovider.cpp
|
|
|
|
LEGO1/omni/src/stream/mxstreamchunk.cpp
|
|
|
|
LEGO1/omni/src/stream/mxstreamcontroller.cpp
|
|
|
|
LEGO1/omni/src/stream/mxstreamer.cpp
|
|
|
|
LEGO1/omni/src/stream/mxstreamlist.cpp
|
|
|
|
LEGO1/omni/src/stream/mxstreamprovider.cpp
|
2024-03-12 10:23:50 -04:00
|
|
|
LEGO1/omni/src/system/mxautolock.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/system/mxcriticalsection.cpp
|
|
|
|
LEGO1/omni/src/system/mxscheduler.cpp
|
|
|
|
LEGO1/omni/src/system/mxsemaphore.cpp
|
|
|
|
LEGO1/omni/src/system/mxthread.cpp
|
2024-05-30 15:03:43 -04:00
|
|
|
LEGO1/omni/src/system/mxticklethread.cpp
|
2024-02-29 12:00:57 -05:00
|
|
|
LEGO1/omni/src/video/flic.cpp
|
2024-01-24 21:16:29 -05:00
|
|
|
LEGO1/omni/src/video/mxbitmap.cpp
|
|
|
|
LEGO1/omni/src/video/mxdisplaysurface.cpp
|
|
|
|
LEGO1/omni/src/video/mxflcpresenter.cpp
|
|
|
|
LEGO1/omni/src/video/mxloopingflcpresenter.cpp
|
|
|
|
LEGO1/omni/src/video/mxloopingsmkpresenter.cpp
|
|
|
|
LEGO1/omni/src/video/mxpalette.cpp
|
|
|
|
LEGO1/omni/src/video/mxregion.cpp
|
|
|
|
LEGO1/omni/src/video/mxregioncursor.cpp
|
|
|
|
LEGO1/omni/src/video/mxsmack.cpp
|
|
|
|
LEGO1/omni/src/video/mxsmkpresenter.cpp
|
|
|
|
LEGO1/omni/src/video/mxstillpresenter.cpp
|
|
|
|
LEGO1/omni/src/video/mxvideomanager.cpp
|
|
|
|
LEGO1/omni/src/video/mxvideoparam.cpp
|
|
|
|
LEGO1/omni/src/video/mxvideoparamflags.cpp
|
|
|
|
LEGO1/omni/src/video/mxvideopresenter.cpp
|
|
|
|
)
|
|
|
|
register_lego1_target(omni)
|
|
|
|
set_property(TARGET omni PROPERTY ARCHIVE_OUTPUT_NAME "omni$<$<CONFIG:Debug>:d>")
|
2024-02-20 12:14:52 -05:00
|
|
|
target_include_directories(omni PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
|
2024-06-16 09:26:04 -04:00
|
|
|
target_link_libraries(omni PRIVATE winmm libsmacker miniaudio)
|
2024-01-24 21:16:29 -05:00
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
add_library(lego1 SHARED
|
2023-09-27 15:16:46 -04:00
|
|
|
LEGO1/define.cpp
|
2024-03-22 21:30:58 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/act2actor.cpp
|
2024-06-12 20:02:47 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/act2genactor.cpp
|
2024-07-08 17:52:50 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/act3actors.cpp
|
2024-06-12 20:02:47 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/act3brickster.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/act3cop.cpp
|
2024-06-03 12:53:25 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/act3shark.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/actors/ambulance.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/bike.cpp
|
2024-06-10 11:44:55 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/buildingentity.cpp
|
2024-06-03 12:53:25 -04:00
|
|
|
LEGO1/lego/legoomni/src/actors/buildings.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/actors/bumpbouy.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/doors.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/dunebuggy.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/helicopter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/isleactor.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/islepathactor.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/jetski.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/motorcycle.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/pizza.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/pizzeria.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/racecar.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/radio.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/skateboard.cpp
|
|
|
|
LEGO1/lego/legoomni/src/actors/towtrack.cpp
|
2024-05-30 10:27:18 -04:00
|
|
|
LEGO1/lego/legoomni/src/audio/lego3dsound.cpp
|
2024-01-20 18:04:46 -05:00
|
|
|
LEGO1/lego/legoomni/src/audio/lego3dwavepresenter.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/audio/legocachsound.cpp
|
2024-03-31 09:09:51 -04:00
|
|
|
LEGO1/lego/legoomni/src/audio/legocachesoundmanager.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/audio/legoloadcachesoundpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/audio/legosoundmanager.cpp
|
2024-01-08 06:45:07 -05:00
|
|
|
LEGO1/lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/build/legocarbuild.cpp
|
2024-06-03 12:53:25 -04:00
|
|
|
LEGO1/lego/legoomni/src/build/legocarbuildpresenter.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp
|
2024-06-01 12:45:34 -04:00
|
|
|
LEGO1/lego/legoomni/src/common/legoactors.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp
|
|
|
|
LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legobackgroundcolor.cpp
|
2024-06-10 11:44:55 -04:00
|
|
|
LEGO1/lego/legoomni/src/common/legobuildingmanager.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legocharactermanager.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legofullscreenmovie.cpp
|
|
|
|
LEGO1/lego/legoomni/src/common/legogamestate.cpp
|
|
|
|
LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
|
2024-04-16 10:07:13 -04:00
|
|
|
LEGO1/lego/legoomni/src/common/legophoneme.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legoplantmanager.cpp
|
2024-06-17 14:11:27 -04:00
|
|
|
LEGO1/lego/legoomni/src/common/legoplants.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legostate.cpp
|
2024-02-23 10:06:16 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legotextureinfo.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legoutils.cpp
|
2024-02-10 20:52:16 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/legovariables.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/misc.cpp
|
2024-01-08 06:45:07 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/common/mxcontrolpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/control/legometerpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/act2brick.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/act2policestation.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legoactor.cpp
|
2024-01-13 17:06:13 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp
|
2024-01-09 04:43:21 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legoentity.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/legojetski.cpp
|
2024-01-20 18:04:46 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp
|
2024-05-10 14:07:38 -04:00
|
|
|
LEGO1/lego/legoomni/src/entity/legolocations.cpp
|
2024-01-09 04:43:21 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/entity/legoworld.cpp
|
|
|
|
LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/input/legoinputmanager.cpp
|
2024-05-04 08:06:32 -04:00
|
|
|
LEGO1/lego/legoomni/src/main/legomain.cpp
|
|
|
|
LEGO1/lego/legoomni/src/main/scripts.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/notify/legoeventnotificationparam.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/paths/legoanimactor.cpp
|
2024-03-23 10:09:20 -04:00
|
|
|
LEGO1/lego/legoomni/src/paths/legoextraactor.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/paths/legopathactor.cpp
|
2024-03-26 13:51:52 -04:00
|
|
|
LEGO1/lego/legoomni/src/paths/legopathboundary.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp
|
|
|
|
LEGO1/lego/legoomni/src/paths/legopathpresenter.cpp
|
2024-05-11 12:23:18 -04:00
|
|
|
LEGO1/lego/legoomni/src/paths/legopathstruct.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/race/carrace.cpp
|
|
|
|
LEGO1/lego/legoomni/src/race/jetskirace.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/race/legorace.cpp
|
|
|
|
LEGO1/lego/legoomni/src/race/legoraceactor.cpp
|
2024-03-22 21:30:58 -04:00
|
|
|
LEGO1/lego/legoomni/src/race/legoracemap.cpp
|
2024-08-04 15:13:12 -04:00
|
|
|
LEGO1/lego/legoomni/src/race/legoracers.cpp
|
|
|
|
LEGO1/lego/legoomni/src/race/legoracespecial.cpp
|
2024-03-22 21:30:58 -04:00
|
|
|
LEGO1/lego/legoomni/src/race/raceskel.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legoflctexturepresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legolocomotionanimpresenter.cpp
|
2024-01-20 18:04:46 -05:00
|
|
|
LEGO1/lego/legoomni/src/video/legoloopinganimpresenter.cpp
|
2024-01-08 04:58:49 -05:00
|
|
|
LEGO1/lego/legoomni/src/video/legomodelpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legopalettepresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legopartpresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legotexturepresenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/video/legovideomanager.cpp
|
2024-03-09 15:07:52 -05:00
|
|
|
LEGO1/lego/legoomni/src/worlds/act3.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/gasstation.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/historybook.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/hospital.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/infocenter.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/isle.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/jukebox.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/legoact2.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/police.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/registrationbook.cpp
|
|
|
|
LEGO1/lego/legoomni/src/worlds/score.cpp
|
2024-01-11 10:02:55 -05:00
|
|
|
LEGO1/main.cpp
|
2024-03-03 15:35:56 -05:00
|
|
|
LEGO1/modeldb/modeldb.cpp
|
2023-06-30 14:34:39 -04:00
|
|
|
)
|
2024-01-24 21:16:29 -05:00
|
|
|
register_lego1_target(lego1)
|
2024-01-08 04:58:49 -05:00
|
|
|
|
2023-10-24 19:24:29 -04:00
|
|
|
if (MINGW)
|
|
|
|
target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500)
|
|
|
|
endif()
|
2023-06-30 14:34:39 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
if (MSVC)
|
2024-06-25 21:47:43 -04:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
|
|
target_sources(lego1 PRIVATE LEGO1/LegoOmni.def)
|
|
|
|
else()
|
|
|
|
target_sources(lego1 PRIVATE LEGO1/LegoOmni64.def)
|
|
|
|
endif()
|
2024-01-24 21:16:29 -05:00
|
|
|
else()
|
|
|
|
target_sources(lego1 PRIVATE LEGO1/LegoOmni.mingw.def)
|
2023-08-06 15:47:16 -04:00
|
|
|
endif()
|
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/util")
|
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1")
|
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/omni/include")
|
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources")
|
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include")
|
2024-03-10 12:08:21 -04:00
|
|
|
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include/actions")
|
2023-12-20 20:07:48 -05:00
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
# Link libraries
|
2024-06-25 21:47:43 -04:00
|
|
|
target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi geom anim Vec::Vec dxguid d3drm_guid misc 3dmanager miniaudio omni)
|
2024-01-24 21:16:29 -05:00
|
|
|
|
|
|
|
foreach(tgt IN LISTS lego1_targets)
|
2024-06-25 21:47:43 -04:00
|
|
|
target_include_directories(${tgt} PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:$<TARGET_PROPERTY:d3drm-wine,INTERFACE_INCLUDE_DIRECTORIES>>)
|
2024-05-30 16:38:42 -04:00
|
|
|
target_link_libraries(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5> SDL3::SDL3)
|
2024-06-25 11:56:30 -04:00
|
|
|
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>)
|
2024-06-26 14:24:40 -04:00
|
|
|
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:D3DRM_WINE>)
|
2024-01-24 21:16:29 -05:00
|
|
|
endforeach()
|
2023-06-30 14:34:39 -04:00
|
|
|
|
|
|
|
# Make sure filenames are ALL CAPS
|
|
|
|
set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1)
|
2024-01-06 12:56:15 -05:00
|
|
|
set_property(TARGET lego1 PROPERTY PREFIX "")
|
2023-06-30 14:34:39 -04:00
|
|
|
set_property(TARGET lego1 PROPERTY SUFFIX ".DLL")
|
2023-06-29 19:39:02 -04:00
|
|
|
|
|
|
|
if (ISLE_BUILD_APP)
|
|
|
|
add_executable(isle WIN32
|
|
|
|
ISLE/res/isle.rc
|
2024-02-05 06:43:13 -05:00
|
|
|
ISLE/isleapp.cpp
|
2023-06-29 19:39:02 -04:00
|
|
|
)
|
2024-06-26 14:24:40 -04:00
|
|
|
add_custom_command(TARGET isle POST_BUILD
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_RUNTIME_DLLS:isle> "$<TARGET_FILE_DIR:isle>"
|
|
|
|
COMMAND_EXPAND_LISTS
|
|
|
|
)
|
2023-06-29 19:39:02 -04:00
|
|
|
|
2024-02-03 11:33:22 -05:00
|
|
|
target_compile_definitions(isle PRIVATE ISLE_APP)
|
|
|
|
|
2023-08-06 15:47:16 -04:00
|
|
|
# Use internal DirectX 5 if required
|
2024-05-31 14:04:00 -04:00
|
|
|
target_link_libraries(isle PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>)
|
|
|
|
|
|
|
|
# Link SDL and iniparser
|
|
|
|
target_link_libraries(isle PRIVATE SDL3::SDL3 iniparser-static)
|
2023-08-06 15:47:16 -04:00
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
# Link DSOUND, WINMM, and LEGO1
|
2024-06-16 09:26:04 -04:00
|
|
|
target_link_libraries(isle PRIVATE winmm lego1)
|
2023-06-29 19:39:02 -04:00
|
|
|
|
2024-06-25 21:47:43 -04:00
|
|
|
target_include_directories(isle PRIVATE $<$<BOOL:${ISLE_D3DRM_FROM_WINE}>:$<TARGET_PROPERTY:d3drm-wine,INTERFACE_INCLUDE_DIRECTORIES>>)
|
|
|
|
|
2023-06-29 19:39:02 -04:00
|
|
|
# Make sure filenames are ALL CAPS
|
|
|
|
set_property(TARGET isle PROPERTY OUTPUT_NAME ISLE)
|
|
|
|
set_property(TARGET isle PROPERTY SUFFIX ".EXE")
|
|
|
|
endif()
|
|
|
|
|
2024-02-07 06:11:45 -05:00
|
|
|
if (ISLE_BUILD_CONFIG)
|
|
|
|
add_executable(config WIN32
|
2024-06-27 15:22:13 -04:00
|
|
|
LEGO1/mxdirectx/mxdirectxinfo.cpp
|
2024-07-08 17:52:50 -04:00
|
|
|
LEGO1/mxdirectx/legodxinfo.cpp
|
2024-02-07 06:11:45 -05:00
|
|
|
CONFIG/config.cpp
|
|
|
|
CONFIG/ConfigCommandLineInfo.cpp
|
|
|
|
CONFIG/AboutDlg.cpp
|
|
|
|
CONFIG/MainDlg.cpp
|
|
|
|
CONFIG/detectdx5.cpp
|
2024-02-09 13:52:49 -05:00
|
|
|
CONFIG/StdAfx.cpp
|
2024-02-07 06:11:45 -05:00
|
|
|
CONFIG/res/config.rc
|
|
|
|
)
|
|
|
|
target_compile_definitions(config PRIVATE _AFXDLL MXDIRECTX_FOR_CONFIG)
|
|
|
|
target_include_directories(config PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/util" "${CMAKE_CURRENT_SOURCE_DIR}/LEGO1")
|
|
|
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
|
|
|
|
target_link_libraries(config PRIVATE DirectX5::DirectX5)
|
|
|
|
endif()
|
|
|
|
target_compile_definitions(config PRIVATE DIRECT3D_VERSION=0x500)
|
2024-06-26 14:24:40 -04:00
|
|
|
target_link_libraries(config PRIVATE SDL3::SDL3)
|
2024-02-07 06:11:45 -05:00
|
|
|
target_link_libraries(config PRIVATE ddraw dxguid)
|
|
|
|
set_property(TARGET config PROPERTY OUTPUT_NAME "CONFIG")
|
|
|
|
set_property(TARGET config PROPERTY SUFFIX ".EXE")
|
|
|
|
set_property(TARGET config PROPERTY MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>DLL)
|
|
|
|
endif()
|
|
|
|
|
2023-06-29 19:39:02 -04:00
|
|
|
if (MSVC)
|
2024-01-10 17:34:32 -05:00
|
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
|
2024-02-07 06:11:45 -05:00
|
|
|
set_property(TARGET ${lego1_targets} APPEND PROPERTY COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS")
|
2024-01-24 21:16:29 -05:00
|
|
|
if (TARGET isle)
|
2024-01-10 17:34:32 -05:00
|
|
|
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
|
|
|
endif()
|
2024-02-07 06:11:45 -05:00
|
|
|
if (TARGET config)
|
|
|
|
target_compile_definitions(config PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
|
|
|
endif()
|
2024-01-10 17:34:32 -05:00
|
|
|
endif()
|
|
|
|
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
|
|
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428")
|
2024-01-24 21:16:29 -05:00
|
|
|
foreach(tgt IN LISTS lego1_targets)
|
|
|
|
target_compile_options(${tgt} PRIVATE "-Zc:__cplusplus")
|
|
|
|
endforeach()
|
|
|
|
if (TARGET isle)
|
2024-01-10 17:34:32 -05:00
|
|
|
target_compile_options(isle PRIVATE "-Zc:__cplusplus")
|
|
|
|
endif()
|
2024-02-07 06:11:45 -05:00
|
|
|
if (TARGET config)
|
|
|
|
target_compile_options(config PRIVATE "-Zc:__cplusplus")
|
|
|
|
endif()
|
2024-01-10 17:34:32 -05:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2024-06-24 10:25:51 -04:00
|
|
|
if(MSVC)
|
|
|
|
target_link_options(isle PRIVATE "/SAFESEH:NO")
|
|
|
|
target_link_options(lego1 PRIVATE "/SAFESEH:NO")
|
|
|
|
endif()
|
2024-05-16 22:11:33 -04:00
|
|
|
|
2024-07-16 22:23:10 -04:00
|
|
|
if (ISLE_DECOMP_ASSERT)
|
|
|
|
message(STATUS "Decomp asserts enabled")
|
2024-02-17 10:07:34 -05:00
|
|
|
foreach(tgt IN LISTS lego1_targets)
|
|
|
|
target_compile_definitions(${tgt} PRIVATE "ENABLE_DECOMP_ASSERTS")
|
|
|
|
endforeach()
|
|
|
|
|
2024-02-07 06:11:45 -05:00
|
|
|
if (TARGET isle)
|
|
|
|
target_compile_definitions(isle PRIVATE "ENABLE_DECOMP_ASSERTS")
|
|
|
|
endif()
|
|
|
|
if (TARGET config)
|
|
|
|
target_compile_definitions(config PRIVATE "ENABLE_DECOMP_ASSERTS")
|
2024-01-10 17:34:32 -05:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (MSVC_FOR_DECOMP)
|
2023-06-29 19:39:02 -04:00
|
|
|
# These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the
|
|
|
|
# game was originally built with) and tweaked slightly to produce more debugging info for reccmp.
|
|
|
|
# They ensure a recompilation that can be byte/instruction accurate to the original binaries.
|
2023-12-08 06:37:44 -05:00
|
|
|
if (ISLE_BUILD_APP)
|
2024-01-21 11:02:17 -05:00
|
|
|
target_link_options(isle PRIVATE "/OPT:REF")
|
2024-02-27 04:21:06 -05:00
|
|
|
set_property(TARGET isle ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
2023-12-08 06:37:44 -05:00
|
|
|
endif()
|
2024-01-21 11:02:17 -05:00
|
|
|
|
2024-02-07 06:11:45 -05:00
|
|
|
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
|
2024-02-27 04:21:06 -05:00
|
|
|
set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
2023-06-29 19:39:02 -04:00
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /D \"NDEBUG\"")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /D \"NDEBUG\"")
|
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "/Os /D \"NDEBUG\"")
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "/machine:I386")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/incremental:yes /debug")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/incremental:no")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/incremental:no")
|
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS "/machine:I386")
|
|
|
|
|
2023-06-29 19:39:02 -04:00
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "/machine:I386")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/incremental:yes /debug")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/incremental:no")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "/incremental:no")
|
2024-01-07 17:31:31 -05:00
|
|
|
|
|
|
|
# Older MSVC versions don't support building in parallel.
|
|
|
|
# Force non-parallel builds of isle and lego1 by putting them in a pool with 1 available job.
|
2024-01-24 21:16:29 -05:00
|
|
|
if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12)
|
2024-02-17 10:07:34 -05:00
|
|
|
foreach(tgt IN LISTS lego1_targets)
|
2024-02-27 04:21:06 -05:00
|
|
|
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1")
|
|
|
|
set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE "msvc_${tgt}")
|
|
|
|
set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}")
|
2024-01-24 21:16:29 -05:00
|
|
|
endforeach()
|
|
|
|
if (TARGET isle)
|
|
|
|
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_isle=1")
|
2024-02-27 04:21:06 -05:00
|
|
|
set_property(TARGET isle PROPERTY JOB_POOL_COMPILE "msvc_isle")
|
|
|
|
set_property(TARGET isle PROPERTY JOB_POOL_LINK "msvc_isle")
|
|
|
|
endif()
|
|
|
|
if (TARGET config)
|
|
|
|
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_config=1")
|
|
|
|
set_property(TARGET config PROPERTY JOB_POOL_COMPILE "msvc_config")
|
|
|
|
set_property(TARGET config PROPERTY JOB_POOL_LINK "msvc_config")
|
2024-01-24 21:16:29 -05:00
|
|
|
endif()
|
2024-01-07 17:31:31 -05:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_program(CLANGFORMAT_BIN NAMES clang-format)
|
|
|
|
if(EXISTS "${CLANGFORMAT_BIN}")
|
|
|
|
execute_process(COMMAND "${CLANGFORMAT_BIN}" --version
|
|
|
|
OUTPUT_VARIABLE "CLANGFORMAT_VERSION_OUTPUT"
|
|
|
|
RESULT_VARIABLE "CLANGFORMAT_RESULT"
|
|
|
|
)
|
|
|
|
if(CLANGFORMAT_RESULT EQUAL 0 AND CLANGFORMAT_VERSION_OUTPUT MATCHES "version ([0-9\\.]+)")
|
|
|
|
set(CLANGFORMAT_VERSION "${CMAKE_MATCH_1}")
|
|
|
|
set(CLANGFORMAT_VERSION_REQUIRED "17.0")
|
|
|
|
message(DEBUG "Found clang-format version ${CLANGFORMAT_VERSION} (needs ${CLANGFORMAT_VERSION_REQUIRED}")
|
|
|
|
if(CLANGFORMAT_VERSION VERSION_GREATER_EQUAL "${CLANGFORMAT_VERSION_REQUIRED}")
|
|
|
|
file(GLOB_RECURSE isle_sources
|
|
|
|
"${PROJECT_SOURCE_DIR}/ISLE/*.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/ISLE/*.h"
|
|
|
|
"${PROJECT_SOURCE_DIR}/LEGO1/*.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/LEGO1/*.h"
|
|
|
|
)
|
|
|
|
string(REPLACE ";" "\n" isle_sources_lines "${isle_sources}")
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/isle_sources.txt" "${isle_sources_lines}\n")
|
|
|
|
add_custom_target(clang-format ${CLANGFORMAT_BIN} -i "--files=${CMAKE_CURRENT_BINARY_DIR}/isle_sources.txt")
|
|
|
|
endif()
|
|
|
|
endif()
|
2023-10-05 16:06:11 -04:00
|
|
|
endif()
|