Disable VIDEOREC if trying to build it with BUILD_ENGINE_C in release builds
authorWuzzy <Wuzzy2@mail.ru>
Fri, 17 May 2019 16:54:30 +0200
changeset 14997 b35a036d6b97
parent 14996 dc50766f6d0c
child 14998 fd29c23ff95e
Disable VIDEOREC if trying to build it with BUILD_ENGINE_C in release builds
CMakeLists.txt
--- a/CMakeLists.txt	Fri May 17 16:49:28 2019 +0200
+++ b/CMakeLists.txt	Fri May 17 16:54:30 2019 +0200
@@ -51,6 +51,14 @@
 option(NOVERSIONINFOUPDATE "Disable update of version_info.txt. To be used if source is in a git/repo that is NOT the hedgewars repo" OFF)
 
 
+if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
+    if((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBUGINFO"))
+        message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
+        set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
+    else()
+        message("WARNING: Video recorder support is currently incompatible with BUILD_ENGINE_C, the video recorder won't work (but demos are fine)! See <https://issues.hedgewars.org/show_bug.cgi?id=722>.")
+    endif()
+endif()
 if(BUILD_ENGINE_JS)
     if(NOT CMAKE_TOOLCHAIN_FILE)
         message(FATAL_ERROR "Missing emscripten toolchain file\nClean your cache and rerun cmake with -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake_modules/Platform/Emscripten.cmake")