Use ghc return value instead of looking for the stderr, do not throw error when an haskell module throws a build failure, e.g. because of false positives like this one (debian/arm*)
authorGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Mon, 29 Dec 2014 12:27:51 +0100
changeset 10726 5e558e193168
parent 10722 37264e44ec0f
child 10766 6db59a502434
Use ghc return value instead of looking for the stderr, do not throw error when an haskell module throws a build failure, e.g. because of false positives like this one (debian/arm*) "You are using a new version of LLVM that hasn't been tested yet! We will try though..."
cmake_modules/CheckHaskellModuleExists.cmake
--- a/cmake_modules/CheckHaskellModuleExists.cmake	Sat Dec 27 11:36:28 2014 -0500
+++ b/cmake_modules/CheckHaskellModuleExists.cmake	Mon Dec 29 12:27:51 2014 +0100
@@ -30,11 +30,11 @@
                     "-DPARAMETERS=${PARAMETERS}"
                     -cpp
                     -c "${CMAKE_MODULE_PATH}/checkModule.hs"
+                    RESULT_VARIABLE COMMAND_RESULT
                     ERROR_VARIABLE BUILD_ERROR
                     OUTPUT_STRIP_TRAILING_WHITESPACE
                     )
-
-    if("${BUILD_ERROR}" STREQUAL "")
+    if(${COMMAND_RESULT} EQUAL 0)
       message(STATUS "Looking for ${FUNCTION} in ${MODULE} - found")
       set(${VARIABLE} 1 CACHE INTERNAL "Have module ${MODULE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log