Skip to content

Commit 3916acd

Browse files
committed
add fake try_compile and try outputting yaml log
1 parent 8201655 commit 3916acd

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3636
set(CMAKE_CXX_STANDARD_REQUIRED YES)
3737
endif()
3838

39+
# Failing inline try_compile example
40+
try_compile(HAS_BOGUS
41+
"${CMAKE_BINARY_DIR}/try_bogus" # binary dir for the test
42+
SOURCE "int main() { return bogus(); }"
43+
)
44+
45+
if(HAS_BOGUS)
46+
message(STATUS "bogus() exists")
47+
else()
48+
message(STATUS "bogus() not found (expected failure)")
49+
endif()
50+
3951
include("cmake/compat_find.cmake")
4052

4153
find_package(Threads REQUIRED)

ci/scripts/ci.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ if ! cmake "$src_dir" "${cmake_args[@]}"; then
4747
# Could add --trace / --trace-expand here too but they are very verbose.
4848
cmake_args+=(--debug-find --debug-trycompile --log-level=DEBUG -DCMAKE_TRY_COMPILE_NO_CLEAN=ON)
4949
cmake "$src_dir" "${cmake_args[@]}" || echo "cmake exited with $?"
50+
echo "=== CMakeConfigureLog.yaml ==="
51+
if [ -f CMakeFiles/CMakeConfigureLog.yaml ]; then
52+
cat CMakeFiles/CMakeConfigureLog.yaml
53+
else
54+
echo "(no configure log found)"
55+
fi
56+
57+
5058
find . -ls
5159
find . -type f -name CMakeOutput.log -exec sh -c 'echo "--- {} ---"; cat "{}"' \;
5260
find . -type f -name CMakeError.log -exec sh -c 'echo "--- {} ---"; cat "{}"' \;

0 commit comments

Comments
 (0)