summaryrefslogtreecommitdiffstats
path: root/CMake/Fixups.cmake
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-05-16 21:59:10 +0200
committerGitHub <noreply@github.com>2020-05-16 21:59:10 +0200
commit9e8598fb1ca359143600d6bb2e8b317126a86bcc (patch)
tree677c51b708937ee8fbcdb2da8e180e874878d77a /CMake/Fixups.cmake
parentTravis: Fix ccache on debug builds (#4741) (diff)
downloadcuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.gz
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.bz2
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.lz
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.xz
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.tar.zst
cuberite-9e8598fb1ca359143600d6bb2e8b317126a86bcc.zip
Diffstat (limited to 'CMake/Fixups.cmake')
-rw-r--r--CMake/Fixups.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMake/Fixups.cmake b/CMake/Fixups.cmake
new file mode 100644
index 000000000..5abff5abd
--- /dev/null
+++ b/CMake/Fixups.cmake
@@ -0,0 +1,14 @@
+# TODO these should be in the submodules
+# Under Windows, we need Lua as DLL; on *nix we need it linked statically:
+if (WIN32)
+ target_compile_definitions(lua PUBLIC LUA_BUILD_AS_DLL)
+endif()
+
+# Let Lua use additional checks on its C API. This is only compiled into Debug builds:
+target_compile_definitions(lua PRIVATE LUA_USE_APICHECK)
+
+if(NOT MSVC AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
+ # mbed TLS uses the frame pointer's register in inline assembly for its bignum implementation:
+ # https://tls.mbed.org/kb/development/arm-thumb-error-r7-cannot-be-used-in-asm-here
+ target_compile_options(mbedcrypto PRIVATE -fomit-frame-pointer)
+endif()