Skip to content

Commit e54de47

Browse files
committed
Add project-no-linkgroups, same as project-linkgroups, but with linkgroups "Off" (failed_build_expected)
1 parent 7882c00 commit e54de47

26 files changed

+166
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
## project-linkgroups
22

33
Test [`linkgroups`](https://premake.github.io/docs/linkgroups) with cyclic dependency
4+
5+
# See also
6+
7+
[project-no-linkgroups](../project-no-linkgroups/)

projects/project-linkgroups/premake5.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ project "app"
1818

1919
files { "src/app/main.cpp" }
2020

21-
linkgroups "On" -- Ideally, we should check there are errors with "Off" for linker(toolset) requiring linksgroup (ld (gcc)).
21+
linkgroups "On" -- See project-no-linkgroups for failed_build_expected with "Off"
2222
libdirs { "%{cfg.targetdir}" }
2323
links { "LibraryA", "LibraryB", "LibraryC" } -- links project: A <-> B <-> C <-> A
2424

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## project-no-linkgroups
2+
3+
Test missing [`linkgroups`](https://premake.github.io/docs/linkgroups) with cyclic dependency
4+
5+
### See also
6+
7+
[project-linkgroups](../project-linkgroups/)

projects/project-no-linkgroups/failed_build_expected

Whitespace-only changes.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
if (_ACTION == nil) then
2+
return
3+
end
4+
5+
local LocationDir = "solution/%{_ACTION}"
6+
7+
workspace "Project"
8+
location(LocationDir)
9+
configurations {"Debug", "Release"}
10+
11+
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName)
12+
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}"))
13+
startproject "app"
14+
15+
project "app"
16+
kind "ConsoleApp"
17+
targetname "app"
18+
19+
files { "src/app/main.cpp" }
20+
21+
linkgroups "Off" -- compilation should pass with "On"
22+
libdirs { "%{cfg.targetdir}" }
23+
links { "LibraryA", "LibraryB", "LibraryC" } -- links project: A <-> B <-> C <-> A
24+
25+
links { "LibD", "LibE", "LibF" } -- links libraries: E <-> F <-> D <-> E
26+
dependson { "LibraryD", "LibraryE", "LibraryF" }
27+
28+
-- TODO: check inter dependency projects with libraries (A <-> D <-> C)
29+
-- possibly with linkoptions { "`xxx-config --libraries`" }
30+
31+
project "LibraryA"
32+
kind "StaticLib"
33+
targetname "LibA"
34+
35+
files { "src/libA/*.cpp" }
36+
37+
project "LibraryB"
38+
kind "staticLib"
39+
targetname "LibB"
40+
41+
files { "src/libB/*.cpp" }
42+
43+
project "LibraryC"
44+
kind "StaticLib"
45+
targetname "LibC"
46+
47+
files { "src/libC/*.cpp" }
48+
49+
project "LibraryD"
50+
kind "staticLib"
51+
targetname "LibD"
52+
53+
files { "src/libD/*.cpp" }
54+
55+
project "LibraryE"
56+
kind "StaticLib"
57+
targetname "LibE"
58+
59+
files { "src/libE/*.cpp" }
60+
61+
project "LibraryF"
62+
kind "staticLib"
63+
targetname "LibF"
64+
65+
files { "src/libF/*.cpp" }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void abca_from_libA();
2+
void acba_from_libA();
3+
void efde_from_libE();
4+
void edfe_from_libE();
5+
6+
int main()
7+
{
8+
abca_from_libA();
9+
acba_from_libA();
10+
efde_from_libE();
11+
edfe_from_libE();
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void a() {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
void a();
2+
void bca_from_libB();
3+
4+
void abca_from_libA() {
5+
a();
6+
bca_from_libB();
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
void a();
2+
void cba_from_libC();
3+
4+
void acba_from_libA() {
5+
a();
6+
cba_from_libC();
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void b() {}

0 commit comments

Comments
 (0)