Browse Source

CMake: don't enable -fPIC by default on Emscripten.

Causes weird errors on latest version.
pull/362/head
Vladimír Vondruš 7 years ago
parent
commit
057475fb8a
  1. 10
      CMakeLists.txt
  2. 3
      doc/changelog.dox

10
CMakeLists.txt

@ -183,7 +183,15 @@ set(MAGNUM_INCLUDE_INSTALL_PREFIX "."
CACHE STRING "Prefix where to put platform-independent include and other files")
option(BUILD_STATIC "Build static libraries (default are shared)" OFF)
option(BUILD_STATIC_PIC "Build static libraries and plugins with position-independent code" ON)
# Disable PIC on Emscripten by default (but still allow it to be enabled
# explicitly if one so desires). Currently causes linker errors related to
# __memory_base etc.: https://github.com/emscripten-core/emscripten/issues/8761
if(CORRADE_TARGET_EMSCRIPTEN)
set(ON_EXCEPT_EMSCRIPTEN OFF)
else()
set(ON_EXCEPT_EMSCRIPTEN ON)
endif()
option(BUILD_STATIC_PIC "Build static libraries and plugins with position-independent code" ${ON_EXCEPT_EMSCRIPTEN})
option(BUILD_PLUGINS_STATIC "Build static plugins (default are dynamic)" OFF)
option(BUILD_TESTS "Build unit tests" OFF)
cmake_dependent_option(BUILD_GL_TESTS "Build unit tests for OpenGL code" OFF "BUILD_TESTS;TARGET_GL" OFF)

3
doc/changelog.dox

@ -377,6 +377,9 @@ See also:
(see [mosra/magnum#345](https://github.com/mosra/magnum/issues/345))
- Fixed a 64-to-32-bit conversion warning on MSVC in @ref GL::Mesh internals
(see [mosra/magnum#352](https://github.com/mosra/magnum/issues/352))
- Emscripten builds now have the `-fPIC` option disabled by default as it
causes linker errors related to `__memory_base` on 1.38.36 (see also
[emscripten-core/emscripten#8761](https://github.com/emscripten-core/emscripten/issues/8761))
@subsection changelog-latest-bugfixes Bug fixes

Loading…
Cancel
Save