File tree 5 files changed +66
-0
lines changed
5 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ project (CMakePlay C)
3
+
4
+ ############ app 1 ##############
5
+
6
+ add_library (a1 STATIC a.c)
7
+ target_link_libraries (a1 PUBLIC b1)
8
+
9
+ add_library (b1 STATIC b.c)
10
+ target_link_libraries (b1 PUBLIC c1)
11
+
12
+ add_library (c1 STATIC c.c)
13
+
14
+ add_executable (app1 main.c)
15
+ target_link_libraries (app1 a1)
16
+
17
+
18
+ ############ app 2 ##############
19
+
20
+ add_library (a2 STATIC a.c)
21
+ target_link_libraries (a2 PUBLIC b2)
22
+
23
+ add_library (b2 STATIC b.c)
24
+ target_link_libraries (b2 PUBLIC c2)
25
+
26
+ add_library (c2 STATIC c.c)
27
+
28
+ add_executable (app2 main.c)
29
+ target_link_libraries (app2 -Wl,--whole-archive a2 -Wl,--no -whole-archive)
30
+
31
+ ############ app 3 ##############
32
+
33
+ add_library (a3 STATIC a.c)
34
+
35
+ add_library (b3 STATIC b.c)
36
+
37
+ add_library (c3 STATIC c.c)
38
+
39
+ add_executable (app3 main.c)
40
+ target_link_libraries (app3 -Wl,--whole-archive a3 b3 c3 -Wl,--no -whole-archive)
Original file line number Diff line number Diff line change
1
+ int bb (int val );
2
+
3
+ int aa (int val )
4
+ {
5
+ return bb (val );
6
+ }
7
+
Original file line number Diff line number Diff line change
1
+ int cc (int val );
2
+
3
+ int bb (int val )
4
+ {
5
+ return cc (val );
6
+ }
7
+
Original file line number Diff line number Diff line change
1
+
2
+ int cc (int val )
3
+ {
4
+ return val + 10 ;
5
+ }
6
+
Original file line number Diff line number Diff line change
1
+ int aa (int val );
2
+
3
+ int main (void )
4
+ {
5
+ return aa (2 );
6
+ }
You can’t perform that action at this time.
0 commit comments