mirror of
https://github.com/AdaCore/spawn.git
synced 2026-02-12 13:09:41 -08:00
121 lines
5.2 KiB
Plaintext
121 lines
5.2 KiB
Plaintext
------------------------------------------------------------------------------
|
|
-- Language Server Protocol --
|
|
-- --
|
|
-- Copyright (C) 2018-2020, AdaCore --
|
|
-- --
|
|
-- This is free software; you can redistribute it and/or modify it under --
|
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
|
-- sion. This software is distributed in the hope that it will be useful, --
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
|
|
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
|
|
-- License for more details. You should have received a copy of the GNU --
|
|
-- General Public License distributed with this software; see file --
|
|
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
|
|
-- of the license. --
|
|
-- --
|
|
-- As a special exception under Section 7 of GPL version 3, you are granted --
|
|
-- additional permissions described in the GCC Runtime Library Exception, --
|
|
-- version 3.1, as published by the Free Software Foundation. --
|
|
------------------------------------------------------------------------------
|
|
|
|
project Spawn is
|
|
|
|
type OS_API_Kind is ("unix", "osx", "Windows_NT");
|
|
OS_API : OS_API_Kind := external ("OS", "unix");
|
|
|
|
type Build_Type is ("Debug", "Production");
|
|
Build : Build_Type := External ("BUILD", "Debug");
|
|
|
|
type Any_Boolean is ("false", "true");
|
|
Warnings_As_Errors : Any_Boolean := "true";
|
|
|
|
-- By default, treat warnings as errors in dev mode, but not in prod
|
|
-- mode. Users may override this default using the SPAWN_WARN_ERRORS
|
|
-- environment variable.
|
|
case Build is
|
|
when "Debug" =>
|
|
Warnings_As_Errors := external ("SPAWN_WARN_ERRORS", "true");
|
|
when "Production" =>
|
|
Warnings_As_Errors := external ("SPAWN_WARN_ERRORS", "false");
|
|
end case;
|
|
|
|
for Source_Dirs use ("../source/spawn");
|
|
for Object_Dir use "../.obj/spawn";
|
|
for Languages use ("Ada", "c");
|
|
|
|
Common_Excluded := ();
|
|
|
|
case OS_API is
|
|
when "unix" =>
|
|
for Excluded_Source_Files use Common_Excluded &
|
|
("pipe2.c",
|
|
"spawn-windows_api.ads",
|
|
"spawn-processes-windows.ads",
|
|
"spawn-processes-windows.adb");
|
|
|
|
when "Windows_NT" =>
|
|
for Excluded_Source_Files use Common_Excluded &
|
|
("pipe2.c",
|
|
"posix_const.c");
|
|
|
|
when "osx" =>
|
|
for Excluded_Source_Files use Common_Excluded &
|
|
("spawn-windows_api.ads",
|
|
"spawn-processes-windows.ads",
|
|
"spawn-processes-windows.adb");
|
|
end case;
|
|
|
|
Ada_Switches := ("-g", "-gnatwa", "-gnatyyO");
|
|
case Warnings_As_Errors is
|
|
when "true" => Ada_Switches := Ada_Switches & ("-gnatwe");
|
|
when "false" => null;
|
|
end case;
|
|
|
|
package Compiler is
|
|
for Switches ("ada") use Ada_Switches;
|
|
end Compiler;
|
|
|
|
package Naming is
|
|
case OS_API is
|
|
when "unix" | "osx" =>
|
|
for Spec ("Spawn.Internal")
|
|
use "spawn-internal__posix.ads";
|
|
for Body ("Spawn.Internal")
|
|
use "spawn-internal__posix.adb";
|
|
for Body ("Spawn.Environments.Initialize_Default")
|
|
use "spawn-environments-initialize_default__posix.adb";
|
|
for Spec ("Spawn.Environments.Internal")
|
|
use "spawn-environments-internal__posix.ads";
|
|
for Body ("Spawn.Environments.Internal")
|
|
use "spawn-environments-internal__posix.adb";
|
|
for Body ("Spawn.Processes")
|
|
use "spawn-processes__posix.adb";
|
|
for Body ("Spawn.Environments.Search_In_Path")
|
|
use "spawn-environments-search_in_path__posix.adb";
|
|
for Body ("Spawn.Processes.Monitor")
|
|
use "spawn-processes-monitor__posix.adb";
|
|
for Body ("Spawn.Processes.Monitor.Initialize")
|
|
use "spawn-processes-monitor-" & OS_API & "_initialize.adb";
|
|
when "Windows_NT" =>
|
|
for Spec ("Spawn.Internal")
|
|
use "spawn-internal__windows.ads";
|
|
for Body ("Spawn.Internal")
|
|
use "spawn-internal__windows.adb";
|
|
for Body ("Spawn.Environments.Initialize_Default")
|
|
use "spawn-environments-initialize_default__windows.adb";
|
|
for Spec ("Spawn.Environments.Internal")
|
|
use "spawn-environments-internal__windows.ads";
|
|
for Body ("Spawn.Environments.Internal")
|
|
use "spawn-environments-internal__windows.adb";
|
|
for Body ("Spawn.Processes")
|
|
use "spawn-processes__windows.adb";
|
|
for Body ("Spawn.Environments.Search_In_Path")
|
|
use "spawn-environments-search_in_path__windows.adb";
|
|
for Body ("Spawn.Processes.Monitor")
|
|
use "spawn-processes-monitor__windows.adb";
|
|
end case;
|
|
end Naming;
|
|
|
|
end Spawn;
|