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*) 0.9.21
authorGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Tue, 30 Dec 2014 19:07:57 +0300
branch0.9.21
changeset 10723 2cfa65083621
parent 10721 9b789de8e5df
child 10727 5f34d3341fc1
child 10728 d58d7d8b5392
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 22:09:31 2014 +0300
+++ b/cmake_modules/CheckHaskellModuleExists.cmake	Tue Dec 30 19:07:57 2014 +0300
@@ -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