~vladh/peony

9377cf56f9ecbabf6c473573bef7aadcc1024d13 — Vlad-Stefan Harbuz 6 months ago 22be96c main
Add Linux build system
4 files changed, 35 insertions(+), 4 deletions(-)

M Makefile
A make_linux.mk
M src/constants.hpp
M src/fonts.cpp
M Makefile => Makefile +2 -0
@@ 8,5 8,7 @@ else
	UNAME_S := $(shell uname -s)
	ifeq ($(UNAME_S),Darwin)
		include make_macos.mk
	else
		include make_linux.mk
	endif
endif

A make_linux.mk => make_linux.mk +29 -0
@@ 0,0 1,29 @@
# Peony Game Engine
# Copyright (C) 2020 Vlad-Stefan Harbuz <vlad@vladh.net>
# All rights reserved.

COMPILER_FLAGS = \
	-I/usr/include/glm/include \
	-I/usr/include/GLFW/include \
	-I/usr/include/assimp/include \
	-I/usr/include/freetype2 \
	-D_FORTIFY_SOURCE=2 -ggdb3 -Og -Wall -Werror -Wextra -pedantic \
	-std=c++2a \
	-Wno-deprecated-volatile -Wno-unused-function -Wno-unknown-pragmas -Wno-comment \
	-Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers \
	-Wno-unused-result -Wno-class-memaccess -Wno-unused-but-set-variable

LINKER_FLAGS = \
  -L/usr/lib/x86_64-linux-gnu \
	-lfreetype -lglfw -lassimp -lm -ldl -pthread

.PHONY: unity run

unity:
	@echo "################################################################################"
	@echo "### Building"
	@echo "################################################################################"
	time g++ $(COMPILER_FLAGS) src/_unity.cpp -o bin/peony $(LINKER_FLAGS)

run:
	@./bin/peony

M src/constants.hpp => src/constants.hpp +3 -3
@@ 57,10 57,10 @@ constexpr real64 PI = 3.14159265358979323846;
#define USE_FOG false
#define USE_VSYNC false

#if defined(PLATFORM_MACOS)
  #define GRAPHICS_LOW
#else
#if defined(PLATFORM_WINDOWS)
  #define GRAPHICS_HIGH
#else
  #define GRAPHICS_LOW
#endif

// Constants

M src/fonts.cpp => src/fonts.cpp +1 -1
@@ 41,7 41,7 @@ namespace fonts {
    for (uint32 c = 0; c < CHAR_MAX_CODEPOINT_TO_LOAD; c++) {
      if (
        // Unicode C0 controls
        (c >= 0x00 && c <= 0x1F) ||
        (c <= 0x1F) ||
        // DEL
        (c == 0x7F) ||
        // Unicode C1 controls