Skip to content

Commit 9a8ec54

Browse files
author
Dejan Jovanovic
committed
attempt to print compile errors when looking for yices2
1 parent 37860ea commit 9a8ec54

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

cmake/FindYices2.cmake

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66

77
if (YICES2_HOME)
88
find_path(YICES2_INCLUDE_DIR yices.h PATHS "${YICES2_HOME}/include" NO_DEFAULT_PATH)
9-
else()
9+
else()
1010
find_path(YICES2_INCLUDE_DIR yices.h)
1111
endif()
1212

1313
if (SALLY_STATIC_BUILD)
1414
if (YICES2_HOME)
1515
find_library(YICES2_LIBRARY libyices.a yices PATHS "${YICES2_HOME}/lib" NO_DEFAULT_PATH)
16-
else()
16+
else()
1717
find_library(YICES2_LIBRARY libyices.a yices)
1818
endif()
1919
else()
2020
if (YICES2_HOME)
2121
find_library(YICES2_LIBRARY yices PATHS "${YICES2_HOME}/lib" NO_DEFAULT_PATH)
22-
else()
22+
else()
2323
find_library(YICES2_LIBRARY yices)
2424
endif()
2525
endif()
2626

2727
# If library found, check the version
2828
if (YICES2_INCLUDE_DIR AND Yices2_FIND_VERSION)
2929

30-
# Check version. It is in yices.h of the form
31-
#
30+
# Check version. It is in yices.h of the form
31+
#
3232
# #define __YICES_VERSION 2
3333
# #define __YICES_VERSION_MAJOR 3
3434
# #define __YICES_VERSION_PATCHLEVEL 0
@@ -49,9 +49,9 @@ if (YICES2_INCLUDE_DIR AND Yices2_FIND_VERSION)
4949
unset(YICES2_LIBRARY CACHE)
5050
elseif (Yices2_FIND_VERSION_EXACT AND NOT "${__YICES_H_VERSION}" VERSION_EQUAL "${Yices2_FIND_VERSION}")
5151
unset(YICES2_INCLUDE_DIR CACHE)
52-
unset(YICES2_LIBRARY CACHE)
52+
unset(YICES2_LIBRARY CACHE)
5353
endif()
54-
54+
5555
# Try to compile and check for MCSAT
5656
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/yices2.c" "
5757
#include <stdio.h>
@@ -65,15 +65,15 @@ if (YICES2_INCLUDE_DIR AND Yices2_FIND_VERSION)
6565
return 0;
6666
}
6767
")
68-
68+
6969
# We need to compile as:
70-
# gcc -I${YICES2_INCLUDE_DIR} -I${GMP_INCLUDE} version_test.cpp ${YICES2_LIBRARY} ${LIBPOLY_LIBRARY} ${GMP_LIBRARY}
70+
# gcc -I${YICES2_INCLUDE_DIR} -I${GMP_INCLUDE} version_test.cpp ${YICES2_LIBRARY} ${LIBPOLY_LIBRARY} ${GMP_LIBRARY}
7171

72-
# Run the test program
72+
# Run the test program
7373
try_run(
74-
MCSAT_TEST_EXITCODE
74+
MCSAT_TEST_EXITCODE
7575
MCSAT_TEST_COMPILED
76-
${CMAKE_BINARY_DIR}
76+
${CMAKE_BINARY_DIR}
7777
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/yices2.c
7878
COMPILE_DEFINITIONS
7979
-I"${YICES2_INCLUDE_DIR}"
@@ -83,22 +83,23 @@ if (YICES2_INCLUDE_DIR AND Yices2_FIND_VERSION)
8383
LINK_LIBRARIES
8484
${YICES2_LIBRARY} ${LIBPOLY_LIBRARY} ${GMP_LIBRARY} ${CUDD_LIBRARY}
8585
CMAKE_FLAGS
86-
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
86+
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
8787
RUN_OUTPUT_VARIABLE
8888
MCSAT_TEST_RUN_OUTPUT
8989
COMPILE_OUTPUT_VARIABLE
9090
MCSAT_TEST_COMPILE_OUTPUT
91-
)
91+
)
9292

9393
if (NOT MCSAT_TEST_COMPILED)
9494
unset(YICES2_INCLUDE_DIR CACHE)
9595
unset(YICES2_LIBRARY CACHE)
96+
message(STATUS "Yices2 test program doesn't compile: ${MCSAT_TEST_COMPILE_OUTPUT}")
9697
elseif (NOT ("${MCSAT_TEST_EXITCODE}" EQUAL 0))
9798
unset(YICES2_INCLUDE_DIR CACHE)
9899
unset(YICES2_LIBRARY CACHE)
99100
message(STATUS "Yices2 found, but doesn't have MCSAT enabled (configure Yices2 with --enable-mcsat).")
100101
endif()
101-
102+
102103
endif()
103104

104105
set(YICES2_LIBRARIES ${YICES2_LIBRARY})

0 commit comments

Comments
 (0)