Yet another CMake implementation ()

* initial cmake implementation

* ci: i guess older cmake doesn't support this

* cmake: add max version to suppress warning

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

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
This commit is contained in:
MattKC 2023-06-29 16:39:02 -07:00 committed by GitHub
parent aa3dfe1808
commit 8476bf06b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 266 additions and 4711 deletions

View file

@ -26,7 +26,7 @@ jobs:
key: dx5sdk
- name: Download DX5 SDK
if: steps.cache-dx5.outputs.cache-hit != 'true'
if: ${{ !steps.cache-dx5.outputs.cache-hit }}
run: |
cd dx5sdk
curl -fLOSs https://archive.org/download/idx5sdk/idx5sdk.exe
@ -34,8 +34,7 @@ jobs:
7z x .\DX5SDK.EXE
- name: Cache DX5 SDK
if: steps.cache-dx5.outputs.cache-hit != 'true'
id: save-dx5
if: ${{ !steps.cache-dx5.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: dx5sdk
@ -47,22 +46,47 @@ jobs:
cd cdrom
.\SETUP.EXE /s
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
# Use 2.8 for maximum backwards compatibility
cmake-version: '2.8.x'
- name: Build
shell: cmd
run: |
call .\msvc420\bin\VCVARS32.BAT x86
mkdir Release
.\msvc420\bin\NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release"
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles"
cmake --build .
- name: Restore cached original binaries
id: cache-original-binaries
uses: actions/cache/restore@v3
with:
path: legobin
key: legobin
- name: Download original island binares
if: ${{ !steps.cache-original-binaries.outputs.cache-hit }}
run: |
C:\msys64\usr\bin\wget.exe https://legoisland.org/download/ISLE.EXE --directory-prefix=legobin
C:\msys64\usr\bin\wget.exe https://legoisland.org/download/LEGO1.DLL --directory-prefix=legobin
- name: Cache original binaries
if: ${{ !steps.cache-original-binaries.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: legobin
key: legobin
- name: Summarize Accuracy
shell: bash
run: |
curl -fLOSs https://legoisland.org/download/ISLE.EXE
curl -fLOSs https://legoisland.org/download/LEGO1.DLL
pip install capstone
pip install colorama
python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB . | tee ISLEPROGRESS.TXT
python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB . | tee LEGO1PROGRESS.TXT
pip install -r tools/reccmp/requirements.txt
python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT
python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT
- name: Compare Accuracy With Current Master
shell: bash
@ -79,11 +103,16 @@ jobs:
with:
name: Win32
path: |
Release
ISLEPROGRESS.HTML
LEGO1PROGRESS.HTML
ISLEPROGRESS.SVG
LEGO1PROGRESS.SVG
build/ISLE.EXE
build/LEGO1.DLL
- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: Accuracy Report
path: |
ISLEPROGRESS.*
LEGO1PROGRESS.*
- name: Upload Continuous Release
shell: bash
@ -100,13 +129,7 @@ jobs:
curl -fLOSs https://raw.githubusercontent.com/probonopd/uploadtool/master/upload.sh
./upload.sh \
Release/ISLE.EXE \
Release/LEGO1.DLL \
ISLEPROGRESS.HTML \
ISLEPROGRESS.TXT \
ISLEPROGRESS.SVG \
ISLEPROGRESS.PNG \
LEGO1PROGRESS.HTML \
LEGO1PROGRESS.TXT \
LEGO1PROGRESS.PNG \
LEGO1PROGRESS.SVG
build/ISLE.EXE \
build/LEGO1.DLL \
ISLEPROGRESS.* \
LEGO1PROGRESS.*

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ Release/
*.ncb
ISLE.EXE
LEGO1.DLL
build/

212
CMakeLists.txt Normal file
View file

@ -0,0 +1,212 @@
cmake_minimum_required(VERSION 2.8...3.5 FATAL_ERROR)
project(isle CXX)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
option(ISLE_BUILD_LIB "Build LEGO1.DLL library" ON)
if (ISLE_BUILD_APP)
add_executable(isle WIN32
ISLE/res/isle.rc
ISLE/isleapp.cpp
ISLE/define.cpp
)
# Include LEGO1 headers in ISLE
target_include_directories(isle PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1")
# Link DSOUND, WINMM, and our fake LEGO1 lib (TODO: replace with real once all exports are implemented)
target_link_libraries(isle PRIVATE dsound winmm "${CMAKE_SOURCE_DIR}/ISLE/ext/lego1.lib")
# Make sure filenames are ALL CAPS
set_property(TARGET isle PROPERTY OUTPUT_NAME ISLE)
set_property(TARGET isle PROPERTY SUFFIX ".EXE")
endif()
if (ISLE_BUILD_LIB)
add_library(lego1 SHARED
LEGO1/act1state.cpp
LEGO1/act2brick.cpp
LEGO1/act2policestation.cpp
LEGO1/act3.cpp
LEGO1/act3shark.cpp
LEGO1/act3state.cpp
LEGO1/ambulance.cpp
LEGO1/ambulancemissionstate.cpp
LEGO1/animstate.cpp
LEGO1/beachhouseentity.cpp
LEGO1/bike.cpp
LEGO1/buildingentity.cpp
LEGO1/bumpbouy.cpp
LEGO1/carrace.cpp
LEGO1/dllmain.cpp
LEGO1/dunebuggy.cpp
LEGO1/elevatorbottom.cpp
LEGO1/gasstation.cpp
LEGO1/gasstationentity.cpp
LEGO1/gasstationstate.cpp
LEGO1/helicopter.cpp
LEGO1/helicopterstate.cpp
LEGO1/historybook.cpp
LEGO1/hospital.cpp
LEGO1/hospitalentity.cpp
LEGO1/hospitalstate.cpp
LEGO1/infocenter.cpp
LEGO1/infocenterdoor.cpp
LEGO1/infocenterentity.cpp
LEGO1/infocenterstate.cpp
LEGO1/isle.cpp
LEGO1/isleactor.cpp
LEGO1/islepathactor.cpp
LEGO1/jetski.cpp
LEGO1/jetskirace.cpp
LEGO1/jukebox.cpp
LEGO1/jukeboxentity.cpp
LEGO1/jukeboxstate.cpp
LEGO1/legoact2state.cpp
LEGO1/legoactioncontrolpresenter.cpp
LEGO1/legoanimactor.cpp
LEGO1/legoanimationmanager.cpp
LEGO1/legoanimmmpresenter.cpp
LEGO1/legoanimpresenter.cpp
LEGO1/legobuildingmanager.cpp
LEGO1/legocachesound.cpp
LEGO1/legocameracontroller.cpp
LEGO1/legocarbuild.cpp
LEGO1/legocarbuildanimpresenter.cpp
LEGO1/legocontrolmanager.cpp
LEGO1/legoentity.cpp
LEGO1/legoentitypresenter.cpp
LEGO1/legoflctexturepresenter.cpp
LEGO1/legohideanimpresenter.cpp
LEGO1/legoinputmanager.cpp
LEGO1/legojetski.cpp
LEGO1/legoloadcachesoundpresenter.cpp
LEGO1/legolocomotionanimpresenter.cpp
LEGO1/legonavcontroller.cpp
LEGO1/legoomni.cpp
LEGO1/legopalettepresenter.cpp
LEGO1/legopathactor.cpp
LEGO1/legopathcontroller.cpp
LEGO1/legopathpresenter.cpp
LEGO1/legophonemepresenter.cpp
LEGO1/legoplantmanager.cpp
LEGO1/legorace.cpp
LEGO1/legosoundmanager.cpp
LEGO1/legostate.cpp
LEGO1/legotexturepresenter.cpp
LEGO1/legovideomanager.cpp
LEGO1/legoworld.cpp
LEGO1/legoworldpresenter.cpp
LEGO1/motorcycle.cpp
LEGO1/mxatomid.cpp
LEGO1/mxaudiopresenter.cpp
LEGO1/mxautolocker.cpp
LEGO1/mxbackgroundaudiomanager.cpp
LEGO1/mxcompositemediapresenter.cpp
LEGO1/mxcompositepresenter.cpp
LEGO1/mxcontrolpresenter.cpp
LEGO1/mxcore.cpp
LEGO1/mxcriticalsection.cpp
LEGO1/mxdiskstreamcontroller.cpp
LEGO1/mxdiskstreamprovider.cpp
LEGO1/mxdsaction.cpp
LEGO1/mxdsanim.cpp
LEGO1/mxdschunk.cpp
LEGO1/mxdsevent.cpp
LEGO1/mxdsfile.cpp
LEGO1/mxdsmediaaction.cpp
LEGO1/mxdsmultiaction.cpp
LEGO1/mxdsobject.cpp
LEGO1/mxdsobjectaction.cpp
LEGO1/mxdsparallelaction.cpp
LEGO1/mxdsselectaction.cpp
LEGO1/mxdsserialaction.cpp
LEGO1/mxdssound.cpp
LEGO1/mxdssource.cpp
LEGO1/mxdsstill.cpp
LEGO1/mxdssubscriber.cpp
LEGO1/mxentity.cpp
LEGO1/mxeventmanager.cpp
LEGO1/mxeventpresenter.cpp
LEGO1/mxflcpresenter.cpp
LEGO1/mxioinfo.cpp
LEGO1/mxloopingflcpresenter.cpp
LEGO1/mxloopingsmkpresenter.cpp
LEGO1/mxmediapresenter.cpp
LEGO1/mxmusicpresenter.cpp
LEGO1/mxnotificationmanager.cpp
LEGO1/mxomni.cpp
LEGO1/mxomnicreateflags.cpp
LEGO1/mxomnicreateparam.cpp
LEGO1/mxomnicreateparambase.cpp
LEGO1/mxpalette.cpp
LEGO1/mxpresenter.cpp
LEGO1/mxsmkpresenter.cpp
LEGO1/mxsoundmanager.cpp
LEGO1/mxsoundpresenter.cpp
LEGO1/mxstillpresenter.cpp
LEGO1/mxstreamer.cpp
LEGO1/mxstring.cpp
LEGO1/mxtimer.cpp
LEGO1/mxtransitionmanager.cpp
LEGO1/mxunknown100dc6b0.cpp
LEGO1/mxvideomanager.cpp
LEGO1/mxvideoparam.cpp
LEGO1/mxvideoparamflags.cpp
LEGO1/mxvideopresenter.cpp
LEGO1/mxwavepresenter.cpp
LEGO1/pizza.cpp
LEGO1/pizzamissionstate.cpp
LEGO1/pizzeria.cpp
LEGO1/pizzeriastate.cpp
LEGO1/police.cpp
LEGO1/policeentity.cpp
LEGO1/policestate.cpp
LEGO1/racecar.cpp
LEGO1/racestandsentity.cpp
LEGO1/racestate.cpp
LEGO1/radio.cpp
LEGO1/radiostate.cpp
LEGO1/registrationbook.cpp
LEGO1/score.cpp
LEGO1/scorestate.cpp
LEGO1/skateboard.cpp
LEGO1/towtrack.cpp
LEGO1/towtrackmissionstate.cpp
)
# Link libraries
target_link_libraries(lego1 PRIVATE ddraw dsound winmm)
# Make sure filenames are ALL CAPS
set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1)
set_property(TARGET lego1 PROPERTY SUFFIX ".DLL")
endif()
if (MSVC)
# 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.
target_compile_options(isle PRIVATE "/ML$<$<CONFIG:Debug>:d>")
target_compile_options(lego1 PRIVATE "/MT$<$<CONFIG:Debug>:d>")
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")
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")
endif()

View file

@ -1,9 +1,9 @@
#include "resource.h"
ISLE_ARROW CURSOR "ISLE/res/arrow.cur"
ISLE_NO CURSOR "ISLE/res/no.cur"
ISLE_BUSY CURSOR "ISLE/res/busy.cur"
APP_ICON ICON "ISLE/res/isle.ico"
ISLE_ARROW CURSOR "arrow.cur"
ISLE_NO CURSOR "no.cur"
ISLE_BUSY CURSOR "busy.cur"
APP_ICON ICON "isle.ico"
1 VERSIONINFO
FILEVERSION 1,1,0,0

4681
isle.mak

File diff suppressed because it is too large Load diff

BIN
isle.mdp

Binary file not shown.