Print server version when starting up.

Also added -ldl to fix cmake compilation on Unix systems.
This commit is contained in:
2020-09-16 20:12:12 +02:00
parent f7571607ba
commit efda6673b5
5 changed files with 22 additions and 3 deletions

View File

@@ -107,6 +107,8 @@ ifneq ($(shell $(WIN_CXX) --version | head -1 | egrep -o [0-9]+ | tail -3 | head
WIN_CXX_OPT_DISABLES=$(WIN_CXX_VANILLA_MINGW_OPT_DISABLES)
endif
CXXFLAGS+= -DGIT_VERSION=\"$(shell git describe --tags)\"
.SUFFIX: .o .c .cpp .h .hpp
.c.o:
@@ -122,13 +124,19 @@ $(SERVER): $(OBJ) $(CHDR) $(CXXHDR)
mkdir -p bin
$(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)
# compatibility with how cmake injects GIT_VERSION
version.h:
touch version.h
src/main.o: version.h
.PHONY: all windows clean nuke
# only gets rid of OpenFusion objects, so we don't need to
# recompile the libs every time
clean:
rm -f src/*.o $(SERVER) $(WIN_SERVER)
rm -f src/*.o $(SERVER) $(WIN_SERVER) version.h
# gets rid of all compiled objects, including the libraries
nuke:
rm -f $(OBJ) $(SERVER) $(WIN_SERVER)
rm -f $(OBJ) $(SERVER) $(WIN_SERVER) version.h