build: switch to nmake build system

This commit is contained in:
itsmattkc 2022-04-01 21:57:16 -07:00
parent ae8b959f29
commit 734420eff3
5 changed files with 70 additions and 79 deletions

View file

@ -32,19 +32,13 @@ jobs:
shell: cmd
run: |
call MSVC600/VC98/Bin/vcvars32.bat
mkdir build
cd build
curl -fLOSs https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip
7z x ninja-win.zip
set PATH=%PATH%;%CD%
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
ninja
nmake
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.1
with:
path:
build/Rebuilder.exe
Rebuilder.exe
- name: Upload to Releases
shell: bash
@ -55,4 +49,4 @@ jobs:
TRAVIS_COMMIT: ${{ github.sha }}
run: |
curl -fLOSs --retry 2 --retry-delay 60 https://github.com/probonopd/uploadtool/raw/master/upload.sh
./upload.sh build/Rebuilder.exe
./upload.sh Rebuilder.exe

6
.gitignore vendored
View file

@ -1,2 +1,8 @@
build*
*.user
*.obj
*.dll
*.exp
*.lib
*.exe
*.res

View file

@ -1,55 +0,0 @@
cmake_minimum_required(VERSION 3.5)
project(Rebuilder LANGUAGES CXX)
set(CMAKE_MFC_FLAG 2)
add_compile_definitions(_AFXDLL)
#
# Build our code injected DLL
#
add_library(Rebld SHARED
cmn/path.cpp
cmn/path.h
lib/config.cpp
lib/config.h
lib/dllmain.cpp
lib/hooks.cpp
lib/hooks.h
lib/mmpassthru.cpp
lib/util.cpp
lib/util.h
)
target_compile_options(Rebld PRIVATE /MT)
target_link_libraries(Rebld PRIVATE winmm.lib dxguid.lib shlwapi.lib)
# Add property grid
set(PROPERTYGRID_BUILD_APP OFF CACHE BOOL "")
add_subdirectory(ext/PropertyGrid)
#
# Build launcher/configuration executable
#
add_executable(Rebuilder WIN32
cmn/path.cpp
cmn/path.h
res/res.rc
res/resource.h
src/app.cpp
src/app.h
src/clinkstatic.cpp
src/clinkstatic.h
src/launcher.cpp
src/launcher.h
src/patchgrid.cpp
src/patchgrid.h
src/tabs.cpp
src/tabs.h
src/window.cpp
src/window.h
)
target_link_libraries(Rebuilder PRIVATE shlwapi.lib ddraw.lib dxguid.lib PropertyGrid)
# Ensure DLL is compiled before resource is built into executable
set_source_files_properties(res/res.rc PROPERTIES OBJECT_DEPENDS Rebld)

51
Makefile Normal file
View file

@ -0,0 +1,51 @@
CC = cl
LD = link
DLL_SOURCES = \
cmn/path.cpp \
lib/config.cpp \
lib/dllmain.cpp \
lib/hooks.cpp \
lib/mmpassthru.cpp \
lib/util.cpp \
EXE_SOURCES = \
cmn/path.cpp \
ext/PropertyGrid/DynDialogEx.cpp \
ext/PropertyGrid/DynDialogItemEx.cpp \
ext/PropertyGrid/ListDynDialogEx.cpp \
ext/PropertyGrid/PropertyGrid.cpp \
ext/PropertyGrid/PropertyGridCombo.cpp \
ext/PropertyGrid/PropertyGridDirectoryPicker.cpp \
ext/PropertyGrid/PropertyGridInPlaceEdit.cpp \
ext/PropertyGrid/PropertyGridMonthCalCtrl.cpp \
ext/PropertyGrid/stdafx.cpp \
src/app.cpp \
src/clinkstatic.cpp \
src/launcher.cpp \
src/patchgrid.cpp \
src/tabs.cpp \
src/window.cpp \
DLL_OBJECTS = $(DLL_SOURCES:.cpp=.obj)
EXE_OBJECTS = $(EXE_SOURCES:.cpp=.obj)
EXE = Rebuilder.exe
DLL = Rebld.dll
RES = res/res.res
RES_SRC = res/res.rc
$(EXE) : $(EXE_OBJECTS) $(RES)
$(LD) /out:$@ /subsystem:windows $** shlwapi.lib ddraw.lib dxguid.lib
.cpp.obj :
$(CC) /nologo /Fo$@ -D_AFXDLL -MD -c $<
$(DLL) : $(DLL_OBJECTS)
$(LD) /out:$@ /dll $** user32.lib winmm.lib shlwapi.lib advapi32.lib
$(RES) : $(RES_SRC) $(DLL)
clean :
del /s /q *.obj *.res *.dll *.exe *.exp *.lib *.res

View file

@ -46,30 +46,25 @@ The latest binaries are available on the [releases page](https://github.com/itsm
## Building
Rebuilder utilizes the [CMake](https://cmake.org/download/) build system. Ensure that it is installed before proceeding with the compilation.
Compilation is currently broken with build systems other than [Ninja](https://ninja-build.org/), so it must be installed until this is addressed.
In order to retain compatibility with Windows 95, Rebuilder is compiled using MSVC 6.0.* For convenience and compatibility, a portable version of MSVC 6.0 is available [here](https://github.com/itsmattkc/MSVC600). Its command line can be accessed by running `VC98/bin/VCVARS32.BAT` from any normal command prompt.
Rebuilder utilizes the NMake build system included with Microsoft Visual C++. In order to retain compatibility with Windows 95, Rebuilder is written specifically for MSVC 6.0.* For convenience and compatibility, a portable version of MSVC 6.0 is available [here](https://github.com/itsmattkc/MSVC600). Its command line can be accessed by running `VC98/bin/VCVARS32.BAT` from any normal command prompt.
Using the MSVC command line:
```bash
# Clone this repository and enter it
# Clone this repository
$ git clone https://github.com/itsmattkc/LEGOIslandRebuilder
# Enter the directory
$ cd LEGOIslandRebuilder
# Create build directory and enter it
$ mkdir build
$ cd build
# Generate the build files
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
# Build the program
$ ninja
$ nmake
```
To clean the source tree of build files, the following command can be used:
```bash
$ nmake clean
```
<i>Note: For unknown reasons, the text rendering may break after recompilation. To fix this, you will need to perform a clean build.</i>