Skip to content

Commit

Permalink
Updates to Travis (#32)
Browse files Browse the repository at this point in the history
Squashed 54 Makefile and Travis changes
  • Loading branch information
clbx authored Jan 27, 2020
1 parent cedc641 commit e0cee9a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

##---------------------------------------------------------------------
Expand All @@ -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/$@ $<

Expand All @@ -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)
4 changes: 2 additions & 2 deletions lib/imgui/imgui_impl_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include "imgui_impl_sdl.h"

// SDL
#include <SDL.h>
#include <SDL_syswm.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
#if defined(__APPLE__)
#include "TargetConditionals.h"
#endif
Expand Down

0 comments on commit e0cee9a

Please sign in to comment.