Add -Wl,-no-as-needed to Linux Makefile.

GCC's linker drops dependency on libGL because neither MuJoCo, GLFW, nor the sample applications themselves explicitly depend on OpenGL symbols.

PiperOrigin-RevId: 439372170
Change-Id: I122d1d9658484e901f422d35395ad5929c7a9021
This commit is contained in:
Saran Tunyasuvunakool
2022-04-04 19:43:58 +01:00
parent 90dea1bdfb
commit 0d5d1f5ff2
+1 -1
View File
@@ -2,7 +2,7 @@
# which is commonly available through your distro's package manager.
# On Debian and Ubuntu, GLFW can be installed via `apt install libglfw3-dev`.
COMMON=-O2 -I../include -L../lib -std=c++11 -pthread -Wl,-rpath,'$$ORIGIN'/../lib
COMMON=-O2 -I../include -L../lib -std=c++11 -pthread -Wl,-no-as-needed -Wl,-rpath,'$$ORIGIN'/../lib
all:
$(CXX) $(COMMON) testxml.cc -lmujoco -o ../bin/testxml