Updated code to build properly on Linux
This commit is contained in:
@@ -40,6 +40,9 @@ GLEW, GLU, freetype2, libvorbisfile, libvorbis, libogg, libopenal, libbz2,
|
|||||||
libXRandR, and libcurl.
|
libXRandR, and libcurl.
|
||||||
|
|
||||||
|
|
||||||
|
sudo apt install libglew-dev libogg-dev libopenal-dev libvorbis-dev zlib1g-dev libfreetype-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev libglew-dev
|
||||||
|
|
||||||
|
|
||||||
## Differences with Commercial Version
|
## Differences with Commercial Version
|
||||||
* The music is not part of the open source release of Star Ruler 2. The data/music/ directory from the commercial
|
* The music is not part of the open source release of Star Ruler 2. The data/music/ directory from the commercial
|
||||||
release can be copied directly into the data/ directory of an open-source build. The music will be detected and played.
|
release can be copied directly into the data/ directory of an open-source build. The music will be detected and played.
|
||||||
|
|||||||
Regular → Executable
@@ -1,6 +1,7 @@
|
|||||||
project(GLFW C)
|
project(GLFW C)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 4.0.0)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
set(GLFW_VERSION_MAJOR "3")
|
set(GLFW_VERSION_MAJOR "3")
|
||||||
set(GLFW_VERSION_MINOR "0")
|
set(GLFW_VERSION_MINOR "0")
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ else
|
|||||||
OSNAME = lin
|
OSNAME = lin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CXXFLAGS += -fPIC
|
||||||
|
LDFLAGS += -lGLEW -lGL -lX11 -lXrandr -lfreetype -lz -lm
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
BINDIR = bin_d/$(OSNAME)$(ARCH)
|
BINDIR = bin_d/$(OSNAME)$(ARCH)
|
||||||
OBJDIR = obj_d/$(OSNAME)$(ARCH)
|
OBJDIR = obj_d/$(OSNAME)$(ARCH)
|
||||||
@@ -36,12 +39,12 @@ else
|
|||||||
endif
|
endif
|
||||||
ifndef NLTO
|
ifndef NLTO
|
||||||
ifeq (,$(findstring g++, $(CC)))
|
ifeq (,$(findstring g++, $(CC)))
|
||||||
CXXFLAGS += -flto=6
|
#CXXFLAGS += -flto=6
|
||||||
else
|
else
|
||||||
CXXFLAGS += -flto=thin
|
#CXXFLAGS += -flto=thin
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
CXXFLAGS += -fno-lto
|
#CXXFLAGS += -fno-lto
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -323,7 +326,7 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
|
|||||||
#Complete binary compile
|
#Complete binary compile
|
||||||
$(BINDIR)/$(BIN): makelibs $(OBJ_FILES) $(LIB_FILES) $(COPY_LIBS)
|
$(BINDIR)/$(BIN): makelibs $(OBJ_FILES) $(LIB_FILES) $(COPY_LIBS)
|
||||||
@mkdir -p $(BINDIR)
|
@mkdir -p $(BINDIR)
|
||||||
@$(CC) $(CXXFLAGS) $(LDFLAGS) $(OBJ_FILES) $(LIB_FILES) -o $@
|
@$(CC) $(CXXFLAGS) $(OBJ_FILES) $(LIB_FILES) -o $@ $(LDFLAGS) -lGL -lGLU -lX11 -lXrandr -lXxf86vm -lXi -lopenal -lcurl -lpng -lvorbisfile
|
||||||
|
|
||||||
makelibs:
|
makelibs:
|
||||||
@mkdir -p $(BINDIR)
|
@mkdir -p $(BINDIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user