mirror of https://github.com/decompals/wibo.git
Add CMakeLists.txt (#8)
* Add CMakeLists.txt * Use CMake in CI * Remove Makefile & update README.md
This commit is contained in:
parent
97c946fd86
commit
4ae7bba638
|
@ -10,26 +10,30 @@ jobs:
|
|||
- name: Install GCC multilib
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-multilib g++-multilib
|
||||
sudo apt-get install -y gcc-multilib g++-multilib ninja-build
|
||||
|
||||
- name: Configure
|
||||
# Replace with RelWithDebInfo when -O2 crash is fixed
|
||||
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||
|
||||
- name: Build
|
||||
run: make -j
|
||||
run: cmake --build build
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
wget https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip
|
||||
unzip GC_WII_COMPILERS.zip
|
||||
MWCIncludes=. ./wibo GC/2.7/mwcceppc.exe -c test/test.c
|
||||
MWCIncludes=. build/wibo GC/2.7/mwcceppc.exe -c test/test.c
|
||||
file test.o
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: wibo
|
||||
path: wibo
|
||||
path: build/wibo
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: wibo
|
||||
files: build/wibo
|
||||
|
|
|
@ -3,3 +3,6 @@ build/
|
|||
*.o
|
||||
|
||||
.vscode/
|
||||
# CLion
|
||||
.idea/
|
||||
cmake-build-*/
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
project(wibo LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -Wall")
|
||||
add_executable(wibo
|
||||
advapi32.cpp
|
||||
files.cpp
|
||||
kernel32.cpp
|
||||
lmgr.cpp
|
||||
loader.cpp
|
||||
main.cpp
|
||||
ole32.cpp
|
||||
user32.cpp
|
||||
version.cpp
|
||||
)
|
||||
install(PROGRAMS wibo DESTINATION bin)
|
|
@ -4,11 +4,14 @@ RUN apt-get update \
|
|||
&& apt-get install -y --no-install-recommends \
|
||||
g++ \
|
||||
g++-multilib \
|
||||
make
|
||||
cmake \
|
||||
ninja-build
|
||||
|
||||
COPY . /wibo
|
||||
|
||||
RUN make -C /wibo
|
||||
# Replace with RelWithDebInfo when -O2 crash is fixed
|
||||
RUN cmake -S /wibo -B /wibo/build -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||
RUN cmake --build /wibo/build
|
||||
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
@ -18,6 +21,6 @@ RUN dpkg --add-architecture i386 \
|
|||
&& apt-get install -y --no-install-recommends \
|
||||
libstdc++6:i386
|
||||
|
||||
COPY --from=build /wibo/wibo /usr/local/sbin/wibo
|
||||
COPY --from=build /wibo/build/wibo /usr/local/sbin/wibo
|
||||
|
||||
CMD /usr/local/sbin/wibo
|
||||
|
|
27
Makefile
27
Makefile
|
@ -1,27 +0,0 @@
|
|||
all: wibo
|
||||
|
||||
CXXFLAGS = -Wall -g -m32 -std=c++17 -lstdc++ -MD
|
||||
LDFLAGS = -lstdc++fs
|
||||
|
||||
BUILD_DIR := build
|
||||
CPP_FILES := $(wildcard *.cpp)
|
||||
O_FILES := $(foreach file,$(CPP_FILES),$(BUILD_DIR)/$(file:.cpp=.o))
|
||||
DEP_FILES := $(O_FILES:.o=.d)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $(BUILD_DIR)
|
||||
|
||||
$(BUILD_DIR)/%.o: %.cpp | $(BUILD_DIR)
|
||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||
|
||||
wibo: $(O_FILES)
|
||||
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
$(RM) -r $(BUILD_DIR) wibo
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
-include $(DEP_FILES)
|
Loading…
Reference in New Issue