summaryrefslogtreecommitdiff
path: root/gcc/ada/make.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r--gcc/ada/make.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index ee0926c5464..a4b2a41ff9f 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -1727,10 +1727,16 @@ package body Make is
Project => Arguments_Project,
Path => Arguments_Path_Name);
- -- If the source is not a source of a project file,
- -- we simply add the saved gcc switches.
+ -- If the source is not a source of a project file, check if
+ -- this is allowed.
if Arguments_Project = No_Project then
+ if not External_Unit_Compilation_Allowed then
+ Make_Failed ("external source, not part of any projects, " &
+ "cannot be compiled (", Source_File_Name, ")");
+ end if;
+
+ -- If it is allowed, simply add the saved gcc switches
Add_Arguments (The_Saved_Gcc_Switches.all);