From c2a5919b5a7f78dbcf280a3dff2ec15dac7b12dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 23 Apr 2013 19:38:11 +0200 Subject: [PATCH] Force static build if building with NaCl's newlib. --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5d5421be..0690dbb43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,14 +65,19 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/") find_package(Corrade REQUIRED) -if(BUILD_STATIC) - set(MAGNUM_BUILD_STATIC 1) -endif() - # If targeting NaCl, set explicit OpenGL ES 2.0 support if(CORRADE_TARGET_NACL) set(TARGET_GLES 1) set(TARGET_GLES2 1) + + # Newlib toolchain supports only static linking + if(CORRADE_TARGET_NACL_NEWLIB) + set(BUILD_STATIC OFF) + endif() +endif() + +if(BUILD_STATIC) + set(MAGNUM_BUILD_STATIC 1) endif() # Check dependencies