Updated code to build properly on Linux

This commit is contained in:
2026-07-11 16:30:24 -06:00
parent beec9bff69
commit 5fe9c4d5cb
4 changed files with 13 additions and 6 deletions
+3
View File
@@ -40,6 +40,9 @@ GLEW, GLU, freetype2, libvorbisfile, libvorbis, libogg, libopenal, libbz2,
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
* 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.
Regular → Executable
View File
+2 -1
View File
@@ -1,6 +1,7 @@
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_MINOR "0")
+8 -5
View File
@@ -13,6 +13,9 @@ else
OSNAME = lin
endif
CXXFLAGS += -fPIC
LDFLAGS += -lGLEW -lGL -lX11 -lXrandr -lfreetype -lz -lm
ifdef DEBUG
BINDIR = bin_d/$(OSNAME)$(ARCH)
OBJDIR = obj_d/$(OSNAME)$(ARCH)
@@ -36,12 +39,12 @@ else
endif
ifndef NLTO
ifeq (,$(findstring g++, $(CC)))
CXXFLAGS += -flto=6
#CXXFLAGS += -flto=6
else
CXXFLAGS += -flto=thin
#CXXFLAGS += -flto=thin
endif
else
CXXFLAGS += -fno-lto
#CXXFLAGS += -fno-lto
endif
endif
@@ -104,7 +107,7 @@ ifeq ($(UNAME), Darwin)
CXXFLAGS += -I/usr/local/Cellar/glew/1.10.0/include
LDFLAGS += -L/usr/local/Cellar/glew/1.10.0/lib
CXXFLAGS += -framework OpenGL -framework Cocoa -framework IOKit
CXXFLAGS += -framework OpenAL
@@ -323,7 +326,7 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
#Complete binary compile
$(BINDIR)/$(BIN): makelibs $(OBJ_FILES) $(LIB_FILES) $(COPY_LIBS)
@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:
@mkdir -p $(BINDIR)