Link GLFW as a shared library by default

Use one option name to control building GLFW as static/shared since it
is not straightforward to set it seperately for the samples and simulate
This commit is contained in:
Levi Burner
2022-06-06 17:46:49 -04:00
parent 1788d23da6
commit 655eec1d63
4 changed files with 21 additions and 37 deletions
+4 -4
View File
@@ -58,8 +58,8 @@ findorfetch(
EXCLUDE_FROM_ALL
)
option(MUJOCO_SAMPLES_STATIC_GLFW "Link MuJoCo sample apps against GLFW statically." ON)
if(MUJOCO_SAMPLES_STATIC_GLFW)
option(MUJOCO_EXTRAS_STATIC_GLFW "Link MuJoCo sample apps and simulate libraries against GLFW statically." OFF)
if(MUJOCO_EXTRAS_STATIC_GLFW)
set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS
OFF
@@ -88,12 +88,12 @@ findorfetch(
EXCLUDE_FROM_ALL
)
if(MUJOCO_SAMPLES_STATIC_GLFW)
if(MUJOCO_EXTRAS_STATIC_GLFW)
set(BUILD_SHARED_LIBS
${BUILD_SHARED_LIBS_OLD}
CACHE BOOL "Build SHARED libraries" FORCE
)
unset(BUILD_SHARED_LIBS_OLD)
unset(MUJOCO_EXTRAS_STATIC_GLFW)
endif()
if(NOT SAMPLE_STANDALONE)