diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/TryCompile/Inner/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/TryCompile/Inner/innerexe.c | 2 | ||||
-rw-r--r-- | Tests/TryCompile/Inner/innerlib.c | 1 |
4 files changed, 9 insertions, 3 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 7895d39..5925a87 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -110,8 +110,9 @@ MESSAGE("Testing try_compile project mode") TRY_COMPILE(TEST_INNER ${TryCompile_BINARY_DIR}/CMakeFiles/Inner ${TryCompile_SOURCE_DIR}/Inner - TryCompileInner) -TEST_ASSERT(TEST_INNER "try_compile project mode failed") + TryCompileInner innerexe + OUTPUT_VARIABLE output) +TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}") ADD_EXECUTABLE(TryCompile pass.c) diff --git a/Tests/TryCompile/Inner/CMakeLists.txt b/Tests/TryCompile/Inner/CMakeLists.txt index 41b94ae..d62bcc4 100644 --- a/Tests/TryCompile/Inner/CMakeLists.txt +++ b/Tests/TryCompile/Inner/CMakeLists.txt @@ -10,4 +10,6 @@ if(NOT SHOULD_PASS) message(FATAL_ERROR "Inner try-compile SHOULD_PASS failed!") endif() -add_executable(inner ../pass.c) +add_library(innerlib innerlib.c) +add_executable(innerexe innerexe.c) +target_link_libraries(innerexe innerlib) diff --git a/Tests/TryCompile/Inner/innerexe.c b/Tests/TryCompile/Inner/innerexe.c new file mode 100644 index 0000000..9b121a1 --- /dev/null +++ b/Tests/TryCompile/Inner/innerexe.c @@ -0,0 +1,2 @@ +extern int innerlib(void); +int main() { return innerlib(); } diff --git a/Tests/TryCompile/Inner/innerlib.c b/Tests/TryCompile/Inner/innerlib.c new file mode 100644 index 0000000..0ce1179 --- /dev/null +++ b/Tests/TryCompile/Inner/innerlib.c @@ -0,0 +1 @@ +int innerlib(void) { return 0; } |