From 028229f8816dc0c6e71520608a6bd4212170295a Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 16 Apr 2015 18:31:29 -0400 Subject: [PATCH] Allow for assembly free[r] tomcrypt builds. --- CMake/DefineOptions.cmake | 7 +++++++ extern/CMakeProject-tomcrypt.cmake | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/CMake/DefineOptions.cmake b/CMake/DefineOptions.cmake index c89f387f15..7f4fcb9b8b 100644 --- a/CMake/DefineOptions.cmake +++ b/CMake/DefineOptions.cmake @@ -16,6 +16,13 @@ option(WITH_JPEG "Build with JPEG Image Support." ON) # Turn this on to set this to a specific release mode. option(WITH_FULL_RELEASE "Build as a proper, full release." OFF) +# Turn this on to compile tomcrypt with no assembly data. This is a portable mode. +option(WITH_PORTABLE_TOMCRYPT "Build with assembly/free tomcrypt, making it portable." OFF) + +# Turn this on to not use the ROLC assembly featurs of tomcrypt. +# If WITH_PORTABLE_TOMCRYPT is ON, this will automatically have no effect. +option(WITH_NO_ROLC_TOMCRYPT "Build without the ROLC assembly instructions for tomcrypt. (Ignored by Apple builds)" OFF) + # Turn this option off to not use the GPL exclusive components. option(WITH_GPL_LIBS "Build with GPL libraries." ON) diff --git a/extern/CMakeProject-tomcrypt.cmake b/extern/CMakeProject-tomcrypt.cmake index 5e6d70b26c..bc86daa1dd 100644 --- a/extern/CMakeProject-tomcrypt.cmake +++ b/extern/CMakeProject-tomcrypt.cmake @@ -269,6 +269,12 @@ add_library("tomcrypt" ${TOMCRYPT_SRC} ${TOMCRYPT_HPP}) set_property(TARGET "tomcrypt" PROPERTY FOLDER "External Libraries") +if (WITH_PORTABLE_TOMCRYPT) + sm_add_compile_definition("tomcrypt" LTC_NO_ASM) +elseif(WITH_NO_ROLC_TOMCRYPT AND NOT APPLE) + sm_add_compile_definition("tomcrypt" LTC_NO_ROLC) +endif() + if (APPLE) sm_add_compile_definition("tomcrypt" LTC_NO_ROLC) sm_append_simple_target_property("tomcrypt" XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS "YES")