summaryrefslogtreecommitdiffstats
path: root/CMake/Fixups.cmake
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-05-28 00:48:49 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-07-12 23:00:07 +0200
commit2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a (patch)
tree8e3922013a79e1bb83797a55ec83eac19bf0d2ce /CMake/Fixups.cmake
parentMore CMake cleanup (diff)
downloadcuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar.gz
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar.bz2
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar.lz
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar.xz
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.tar.zst
cuberite-2c0fc395ba95bcaa3b877b88ebd2d1ee0affff9a.zip
Diffstat (limited to 'CMake/Fixups.cmake')
-rw-r--r--CMake/Fixups.cmake26
1 files changed, 14 insertions, 12 deletions
diff --git a/CMake/Fixups.cmake b/CMake/Fixups.cmake
index 5abff5abd..374196d09 100644
--- a/CMake/Fixups.cmake
+++ b/CMake/Fixups.cmake
@@ -1,14 +1,16 @@
-# 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()
+function(emit_fixups)
+ # 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)
+ # 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()
+ 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()
+endfunction()