-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eyraud/48' into 'master'
Set GPR.Opt.Target_Value when target is explicitly set Closes #48 See merge request eng/toolchain/gnatcoll-core!93
- Loading branch information
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
testsuite/tests/projects/project_attribute/main_common.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
abstract project Main_Common is | ||
|
||
Target := project'Target; | ||
|
||
Target_Dir := "error :("; | ||
case Target is | ||
when "x86_64-pc-linux-gnu" => | ||
Target_Dir := "obj-x86"; | ||
when others => | ||
Target_Dir := "unknown-"; | ||
end case; | ||
|
||
Build_Dir := "../" & Target_Dir; | ||
|
||
end Main_Common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
with "main_common.gpr"; | ||
|
||
project Main_x86 is | ||
|
||
for Target use "x86_64-pc-linux-gnu"; | ||
|
||
for Languages use ("Ada"); | ||
|
||
for Source_Dirs use ("."); | ||
|
||
for Main use ("main.adb"); | ||
|
||
for Object_Dir use Main_Common.Build_Dir; | ||
|
||
end Main_x86; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
with GNATCOLL.Projects; use GNATCOLL.Projects; | ||
with GNATCOLL.VFS; use GNATCOLL.VFS; | ||
|
||
with Test_Assert; | ||
|
||
function Test return Integer is | ||
PT : Project_Tree; | ||
Env : Project_Environment_Access; | ||
begin | ||
Initialize (Env); | ||
Env.Set_Target_And_Runtime (Target => "x86_64-pc-linux-gnu"); | ||
|
||
GNATCOLL.Projects.Load | ||
(PT, | ||
Root_Project_Path => Create ("main_x86.gpr"), | ||
Env => Env); | ||
|
||
-- Check that the object directory name is as expected | ||
|
||
Test_Assert.Assert | ||
(PT.Root_Project.Object_Dir.Base_Dir_Name = "obj-x86"); | ||
|
||
PT.Unload; | ||
Free (Env); | ||
return Test_Assert.Report; | ||
end Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
description: Check that the value for the Project attribute is correct | ||
data: | ||
- "main_common.gpr" | ||
- "main_x86.gpr" | ||
control: | ||
- [SKIP, "env.is_cross", "Libutil missing from cross-linux sysroots, see T616-039"] |