Skip to content

Commit

Permalink
Add -Wl,-no-as-needed to Linux Makefile.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
saran-t committed Apr 4, 2022
1 parent 90dea1b commit 0d5d1f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d5d1f5

Please sign in to comment.