diff options
author | Amitha Perera <perera@cs.rpi.edu> | 2002-05-10 17:35:42 (GMT) |
---|---|---|
committer | Amitha Perera <perera@cs.rpi.edu> | 2002-05-10 17:35:42 (GMT) |
commit | 0e6b39e52f561228e3e17bafe4bc7a44da88bf00 (patch) | |
tree | 565638d08eebd83d40cc7ff387b0bbc0994729f8 /Tests/LinkLine | |
parent | 6b08b83d892672f0a5849af71441cb06dc2b45e8 (diff) | |
download | CMake-0e6b39e52f561228e3e17bafe4bc7a44da88bf00.zip CMake-0e6b39e52f561228e3e17bafe4bc7a44da88bf00.tar.gz CMake-0e6b39e52f561228e3e17bafe4bc7a44da88bf00.tar.bz2 |
BUG: Correct some of the dependency analysis code.
- Make sure the original link line is untouched
- Avoid duplicating the link line when supporting version < 1.4
- Make sure the cyclic dependencies and such are output correctly in
complicated cases.
- Avoid outputing dependencies that are already satisfied on the original
link line when possible.
Diffstat (limited to 'Tests/LinkLine')
-rw-r--r-- | Tests/LinkLine/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/LinkLine/Exec.c | 9 | ||||
-rw-r--r-- | Tests/LinkLine/One.c | 10 | ||||
-rw-r--r-- | Tests/LinkLine/Two.c | 10 |
4 files changed, 41 insertions, 0 deletions
diff --git a/Tests/LinkLine/CMakeLists.txt b/Tests/LinkLine/CMakeLists.txt new file mode 100644 index 0000000..a7d138d --- /dev/null +++ b/Tests/LinkLine/CMakeLists.txt @@ -0,0 +1,12 @@ +PROJECT( LinkLine ) + +# Makes sure that the library order as specified by the user are +# unchanged by dependency analysis, etc. libOne and libTwo are +# dependent on each other. The link line should be -lOne -lTwo -lOne. + +ADD_LIBRARY( One One.c ) +ADD_LIBRARY( Two Two.c ) + +LINK_LIBRARIES( One Two ) +ADD_EXECUTABLE( Exec Exec.c ) +LINK_LIBRARIES( One ) diff --git a/Tests/LinkLine/Exec.c b/Tests/LinkLine/Exec.c new file mode 100644 index 0000000..807a7a8 --- /dev/null +++ b/Tests/LinkLine/Exec.c @@ -0,0 +1,9 @@ +void OneFunc(); +void TwoFunc(); + +int main() +{ + OneFunc(); + TwoFunc(); + return 0; +} diff --git a/Tests/LinkLine/One.c b/Tests/LinkLine/One.c new file mode 100644 index 0000000..167f07d --- /dev/null +++ b/Tests/LinkLine/One.c @@ -0,0 +1,10 @@ +void TwoFunc(); + +void OneFunc() +{ + static int i = 0; + ++i; + if( i==1 ) { + TwoFunc(); + } +} diff --git a/Tests/LinkLine/Two.c b/Tests/LinkLine/Two.c new file mode 100644 index 0000000..0db73a8 --- /dev/null +++ b/Tests/LinkLine/Two.c @@ -0,0 +1,10 @@ +void OneFunc(); + +void TwoFunc() +{ + static int i = 0; + ++i; + if( i==1 ) { + OneFunc(); + } +} |