summaryrefslogtreecommitdiffstats
path: root/Tests/TryCompile/Inner
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-08-04 18:37:46 (GMT)
committerBrad King <brad.king@kitware.com>2009-08-04 18:37:46 (GMT)
commit80c947b3975825f2a9a7b1ebdc285e6b0cf6ba02 (patch)
tree85d047b0e5023e668a4804833198d4dcf767a539 /Tests/TryCompile/Inner
parentf3cd1e06f5a5fb092f249de3e1b582125d067daa (diff)
downloadCMake-80c947b3975825f2a9a7b1ebdc285e6b0cf6ba02.zip
CMake-80c947b3975825f2a9a7b1ebdc285e6b0cf6ba02.tar.gz
CMake-80c947b3975825f2a9a7b1ebdc285e6b0cf6ba02.tar.bz2
No /fast targets in try_compile project mode
The try_compile command builds the cmTryCompileExec executable using the cmTryCompileExec/fast target with Makefile generators in order to save time since dependencies are not needed. However, in project mode the command builds an entire source tree that may have dependencies. Therefore we can use the /fast target approach only in one-source mode.
Diffstat (limited to 'Tests/TryCompile/Inner')
-rw-r--r--Tests/TryCompile/Inner/CMakeLists.txt4
-rw-r--r--Tests/TryCompile/Inner/innerexe.c2
-rw-r--r--Tests/TryCompile/Inner/innerlib.c1
3 files changed, 6 insertions, 1 deletions
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; }