try_run: Add test for bad link libraries.
Based off the corresponding try_compile test.
This commit is contained in:
parent
e2b1f0583f
commit
223c5cb70b
|
@ -130,6 +130,7 @@ add_RunCMake_test(project)
|
|||
add_RunCMake_test(return)
|
||||
add_RunCMake_test(string)
|
||||
add_RunCMake_test(try_compile)
|
||||
add_RunCMake_test(try_run)
|
||||
add_RunCMake_test(set)
|
||||
add_RunCMake_test(variable_watch)
|
||||
add_RunCMake_test(CMP0004)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,5 @@
|
|||
CMake Error at BadLinkLibraries.cmake:2 \(try_run\):
|
||||
Only libraries may be used as try_compile or try_run IMPORTED
|
||||
LINK_LIBRARIES. Got not_a_library of type UTILITY.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
|
@ -0,0 +1,4 @@
|
|||
add_custom_target(not_a_library)
|
||||
try_run(RUN_RESULT COMPILE_RESULT
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
||||
LINK_LIBRARIES not_a_library)
|
|
@ -0,0 +1,3 @@
|
|||
cmake_minimum_required(VERSION 2.8.0)
|
||||
project(${RunCMake_TEST} C)
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1,3 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(BadLinkLibraries)
|
|
@ -0,0 +1 @@
|
|||
int main(void) { return 0; }
|
Loading…
Reference in New Issue