$OpenBSD: patch-CMakeLists_txt,v 1.2 2016/09/04 14:03:00 landry Exp $
--- CMakeLists.txt.orig	Wed Jun 15 09:17:23 2016
+++ CMakeLists.txt	Sat Aug 20 13:36:13 2016
@@ -154,14 +154,6 @@ else()
     set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}")
     # Also see CMP0043...
 
-    # Optimizations are enabled unconditionally because they make a big difference in the speed of the
-    # resulting binaries, and that it is better to allow an opt-out from them by adjusting CXXFLAGS through
-    # an env var at cmake time if needed.
-    # The reason for not manipulating just CMAKE_CXX_FLAGS_DEBUG is that unrecognized build types ("DebugFull")
-    # should still benefit from these optimizations. Yup, it would be even better if CMake did a sane thing
-    # and warned when users set an unrecognized and unused build type, but that just isn't the case.
-    set(CMAKE_CXX_FLAGS "-O2 ${CMAKE_CXX_FLAGS}")
-
     # Build warnings are useful tools (and Trojita should be warning-free anyway), enable them on all
     # configurations. They are warnings, not errors.
     set(CMAKE_CXX_FLAGS "-Wall -Wsign-compare ${CMAKE_CXX_FLAGS}")
@@ -786,32 +778,6 @@ if(WITH_TESTS)
     trojita_test(Imap Imap_Offline)
     trojita_test(Imap Imap_CopyAndFlagOperations)
     trojita_test(Cryptography Cryptography_MessageModel)
-
-    if(WITH_CRYPTO_MESSAGES)
-      find_program(GPGCONF_BINARY NAMES gpgconf)
-      if(GPGCONF_BINARY_NOTFOUND)
-        message(SEND_ERROR "The `gpgconf` binary from GnuPG not found, this is needed for crypto tests.")
-      endif()
-
-      if(NOT UNIX)
-        message(SEND_ERROR "The Cryptography unit tests really need Unix. Patches welcome.")
-      endif()
-
-      add_library(fake-dev-random SHARED ${CMAKE_CURRENT_SOURCE_DIR}/tests/Utils/fake-dev-random.c)
-      target_link_libraries(fake-dev-random dl)
-
-      # FIXME: it would be nice to depend on the contents of keys/, but in my testing it produces Makefiles
-      # which suffer from races (the keygen.sh is run multiple times in parallel within the CI environment).
-      # I wasn't able to track down the root cause behind this; it affected all cmake versions within the CI
-      # as of Feb 2016, which is 3.1.something up to 3.3.something.
-      add_custom_command(OUTPUT crypto_test_data.h
-        COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/tests/Cryptography/keygen.sh ${CMAKE_CURRENT_SOURCE_DIR}
-        DEPENDS fake-dev-random tests/Cryptography/keygen.sh tests/Cryptography/batch-keygen)
-      add_custom_target(crypto_test_data DEPENDS crypto_test_data.h)
-
-      trojita_test(Cryptography Cryptography_PGP)
-      add_dependencies(test_Cryptography_PGP crypto_test_data)
-    endif()
 
     trojita_test(Misc Rfc5322)
     trojita_test(Misc RingBuffer)
