diff --git a/.travis.yml b/.travis.yml index b1e9391..4e34692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,15 @@ matrix: before_install: - sudo apt update - sudo apt install libsdl2-dev + - os: windows + arch: amd64 + before_install: + - wget https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz + - tar -xf SDL2-devel-2.0.10-mingw.tar.gz + - cd SDL2-2.0.10 + - cp -r x86_64-w64-mingw32 /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64 + - cd .. + - choco install make -version 4.3 - os: osx before_install: - brew update @@ -26,3 +35,14 @@ script: - ./test - cd .. - make + + +deploy: + provider: releases + api_key: $GITHUB_OATH + file: "cosmic.exe" + skip_cleanup: true + draft: true + on: + branch: travis + tags: true diff --git a/Makefile b/Makefile index 6479d5f..d8fb745 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ VPATH = src:bin OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) BINS = $(addprefix bin/, $(OBJS)) UNAME_S := $(shell uname -s) +ARCH := $(shell gcc -dumpmachine) CXXFLAGS = -Ilib/imgui CXXFLAGS += -g -Wformat -Wno-unknown-pragmas @@ -36,12 +37,12 @@ ifeq ($(UNAME_S), Darwin) #APPLE CFLAGS = $(CXXFLAGS) endif -ifeq ($(findstring MINGW,$(UNAME_S)),MINGW) - ECHO_MESSAGE = "MinGW" - LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` - CXXFLAGS += -Ilibs/gl3w `pkg-config --cflags sdl2` -lmingw32 -lSDL2main -lSDL2 -mwindows -Wall - CFLAGS = $(CXXFLAGS) +ifeq ($(ARCH),x86_64-w64-mingw32) + ECHO_MESSAGE = "MinGW" + LIBS += -lgdi32 -lopengl32 -limm32 + CXXFLAGS += -Ilibs/gl3w -I/lib -lmingw32 -lSDL2main -lSDL2 -mwindows -static-libgcc -static-libstdc++ -lpthread + CFLAGS = $(CXXFLAGS) endif ##--------------------------------------------------------------------- @@ -50,18 +51,17 @@ endif %.o:%.cpp - mkdir -p bin - $(CXX) $(CXXFLAGS) -c -o bin/$@ $< - -%.o:%.cpp + @echo $(ARCH) mkdir -p bin $(CXX) $(CXXFLAGS) -c -o bin/$@ $< %.o:lib/imgui/%.cpp + @echo $(ECHO_MESSAGE) mkdir -p bin $(CXX) $(CXXFLAGS) -c -o bin/$@ $< %.o:lib/gl3w/GL/%.c + @echo $(ECHO_MESSAGE) mkdir -p bin $(CC) $(CFLAGS) -c -o bin/$@ $< @@ -70,8 +70,11 @@ all: $(EXE) @echo Build complete for $(ECHO_MESSAGE) $(EXE): $(OBJS) + @echo $(ARCH) $(CXX) -o $@ $(BINS) $(CXXFLAGS) $(LIBS) + ls -al rm -f imgui.ini clean: + @echo $(ECHO_MESSAGE) rm -f $(EXE) $(OBJS) diff --git a/lib/imgui/imgui_impl_sdl.cpp b/lib/imgui/imgui_impl_sdl.cpp index 1922068..33b7ff9 100644 --- a/lib/imgui/imgui_impl_sdl.cpp +++ b/lib/imgui/imgui_impl_sdl.cpp @@ -43,8 +43,8 @@ #include "imgui_impl_sdl.h" // SDL -#include -#include +#include +#include #if defined(__APPLE__) #include "TargetConditionals.h" #endif