Add icon to windows binary

This commit is contained in:
Timothy Warren 2015-04-16 22:07:51 -04:00
parent 6dec55b0d2
commit f9d677516a
4 changed files with 37 additions and 21 deletions

View File

@ -10,19 +10,20 @@ PROGRAM_SRC = $(wildcard src/*.cpp src/widgets/*.cpp)
PROGRAM = build/Tyro PROGRAM = build/Tyro
PROGRAM_OBJECTS = $(patsubst %.cpp,%.o, $(PROGRAM_SRC)) PROGRAM_OBJECTS = $(patsubst %.cpp,%.o, $(PROGRAM_SRC))
BASE_FLAGS = -DSCI_LEXER WX_LDLIBS = $(shell wx-config --libs base core aui stc adv) -lssh2
WX_CXXFLAGS = $(shell wx-config --cxxflags)
WX_RES = $(shell wx-config --rescomp)
LDLIBS = $(TARGET)
LDLIBS = $(TARGET) $(shell wx-config --libs base core aui stc adv) -lssh2
WX_CXXFLAGS = $(shell wx-config --cxxflags) $(BASE_FLAGS)
DEV_CXXFLAGS = -g -Wall -Wextra DEV_CXXFLAGS = -g -Wall -Wextra
CXXFLAGS = -Os CXXFLAGS = -Os -s
TEST_SRC = $(wildcard tests/*.cpp) TEST_SRC = $(wildcard tests/*.cpp)
TESTS = $(patsubst %.cpp,%,$(TEST_SRC)) TESTS = $(patsubst %.cpp,%,$(TEST_SRC))
UNAME = $(shell uname -s) OS ?= $(shell uname -s)
# Add the /lib search directory for MSyS on Windows
ifdef OS
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
LDLIBS += -L/lib LDLIBS += -L/lib
endif endif
@ -41,7 +42,6 @@ json_wrapper_build:
build: build:
@mkdir -p build @mkdir -p build
#$(TARGET): CXXFLAGS +=
$(TARGET): $(OBJECTS) $(TARGET): $(OBJECTS)
ar rcs $@ $(OBJECTS) ar rcs $@ $(OBJECTS)
ranlib $@ ranlib $@
@ -49,19 +49,32 @@ $(TARGET): $(OBJECTS)
$(PROGRAM): CXXFLAGS += $(WX_CXXFLAGS) $(TARGET) $(PROGRAM): CXXFLAGS += $(WX_CXXFLAGS) $(TARGET)
$(PROGRAM): $(PROGRAM):
$(CXX) $(WX_CXXFLAGS) $(PROGRAM_SRC) $(LDLIBS) -o $(PROGRAM) $(CXX) $(WX_CXXFLAGS) $(PROGRAM_SRC) $(LDLIBS) $(WX_LDLIBS) -o $(PROGRAM)
run: run:
./build/Tyro ./build/Tyro
release: all release:
ifeq ($(UNAME),Darwin) ifeq ($(OS),Darwin)
make Tyro.app make Tyro.app
endif endif
ifeq ($(OS),Windows_NT)
make exe
endif
ifeq ($(OS),Linux)
make all
endif
# strip -sxX $(PROGRAM)
msw_resource:
$(WX_RES) resources/platform/msw/resource.rc -O coff -o resource.res
exe: LDLIBS += resource.res
exe: msw_resource all
Tyro.app: all resources/platform/osx/Info.plist Tyro.app: all resources/platform/osx/Info.plist
strip -sxX $(PROGRAM)
SetFile -t APPL $(TARGET) SetFile -t APPL $(TARGET)
-mkdir Tyro.app -mkdir Tyro.app
-mkdir Tyro.app/Contents -mkdir Tyro.app/Contents
@ -79,9 +92,11 @@ tests: $(TESTS)
sh ./tests/runtests.sh sh ./tests/runtests.sh
clean: clean:
rm -f *.res
rm -f config/json2c rm -f config/json2c
rm -f config/json2c.exe
rm -f config/*_json.h rm -f config/*_json.h
rm -f *.o rm -rf *.o
rm -rf Tyro.app rm -rf Tyro.app
rm -rf build $(OBJECTS) $(PROGRAM) $(TARGET) $(TESTS) rm -rf build $(OBJECTS) $(PROGRAM) $(TARGET) $(TESTS)
find . -name "*.gc*" -exec rm {} \; find . -name "*.gc*" -exec rm {} \;

View File

@ -0,0 +1 @@
APP_ICON ICON "tyro.ico"

View File

@ -33,8 +33,8 @@ private:
TyroConfig *config; TyroConfig *config;
enum enum
{ {
MARGIN_LINE_NUMBERS, MARGIN_FOLD,
MARGIN_FOLD MARGIN_LINE_NUMBERS
}; };
void BindEvents(); void BindEvents();
void OnMarginClick(wxStyledTextEvent &event); void OnMarginClick(wxStyledTextEvent &event);

View File

@ -61,7 +61,7 @@ void MainFrame::SetupToolbar()
wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW); wxBitmap new_file_icon = wxArtProvider::GetBitmap(wxART_NEW);
wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN); wxBitmap open_file_icon = wxArtProvider::GetBitmap(wxART_FILE_OPEN);
wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE); wxBitmap save_file_icon = wxArtProvider::GetBitmap(wxART_FILE_SAVE);
wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_FILE_CLOSE); wxBitmap close_file_icon = wxArtProvider::GetBitmap(wxART_CLOSE);
wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY); wxBitmap copy_icon = wxArtProvider::GetBitmap(wxART_COPY);
wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT); wxBitmap cut_icon = wxArtProvider::GetBitmap(wxART_CUT);
wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE); wxBitmap paste_icon = wxArtProvider::GetBitmap(wxART_PASTE);