You've already forked Ada_Drivers_Library
mirror of
https://github.com/AdaCore/Ada_Drivers_Library.git
synced 2026-02-12 12:26:55 -08:00
This patch makes style checks and warning as error switches controllable with a scenario variable: ADL_BUILD_CHECKS (disabled by default). With this we can enforce style checks on all contributions by enabling ADL_BUILD_CHECKS in testsuite runs and CI builds. On the other hand the checks are disabled by default which means it is easier and more friendly to play with the library and the examples. Part of #271
86 lines
3.6 KiB
Plaintext
86 lines
3.6 KiB
Plaintext
-- This project file was generated by the Ada_Drivers_Library project wizard script
|
|
library project Native is
|
|
|
|
type Build_Type is ("Debug", "Production");
|
|
Build : Build_Type := external ("ADL_BUILD", "Debug");
|
|
|
|
type Build_Checks_Type is ("Disabled", "Enabled");
|
|
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
|
|
|
|
-- Target architecture
|
|
Target := Project'Target;
|
|
|
|
-- Callgraph info is not available on all architectures
|
|
Callgraph_Switch := ();
|
|
case Target is
|
|
when "riscv32-unknown-elf" => null;
|
|
when others => Callgraph_Switch := ("-fcallgraph-info=su");
|
|
end case;
|
|
|
|
Build_Checks_Switches := ();
|
|
case Build_Checks is
|
|
when "Disabled" => null;
|
|
when others =>
|
|
Build_Checks_Switches :=
|
|
("-gnaty", "-gnatyM120", "-gnatyO", -- Style checks
|
|
"-gnatwe"); -- Warnings as errors
|
|
end case;
|
|
|
|
package Compiler is
|
|
case Build is
|
|
when "Production" =>
|
|
for Default_Switches ("Ada") use
|
|
("-O3", -- Optimization
|
|
"-gnatp", -- Supress checks
|
|
"-gnatn"); -- Enable inlining
|
|
when "Debug" =>
|
|
for Default_Switches ("Ada") use
|
|
("-O0", -- No optimization
|
|
"-gnata") -- Enable assertions
|
|
& Callgraph_Switch;
|
|
end case;
|
|
|
|
for Default_Switches ("ada") use Compiler'Default_Switches ("Ada") &
|
|
Callgraph_Switch &
|
|
Build_Checks_Switches &
|
|
("-g", -- Debug info
|
|
"-gnatwa", -- All warnings
|
|
"-gnatQ", -- Don't quit. Generate ALI and tree files even if illegalities
|
|
"-gnatw.X", -- Disable warnings for No_Exception_Propagation
|
|
"-ffunction-sections", -- Create a linker section for each function
|
|
"-fdata-sections"); -- Create a linker section for each data
|
|
end Compiler;
|
|
|
|
for Languages use ("Ada");
|
|
for Create_Missing_Dirs use "True";
|
|
for Object_Dir use "obj_" & Build;
|
|
for Library_Dir use "obj_lib_" & Build;
|
|
for Library_Kind use "static";
|
|
for Library_Name use "ada_drivers_library";
|
|
|
|
Max_Mount_Points := "2"; -- From default value
|
|
Max_Mount_Name_Length := "128"; -- From default value
|
|
Has_Ravenscar_Full_Runtime := "False"; -- From default value
|
|
Board := "Native"; -- From command line
|
|
Has_ZFP_Runtime := "False"; -- From default value
|
|
Has_Ravenscar_SFP_Runtime := "False"; -- From default value
|
|
Max_Path_Length := "1024"; -- From default value
|
|
Architecture := "Native"; -- From board definition
|
|
|
|
-- Project source directories
|
|
Src_Dirs_Root := "../..";
|
|
for Source_Dirs use (
|
|
Src_Dirs_Root & "/hal/src/", -- From HAL config
|
|
Src_Dirs_Root & "/boards/native/src/", -- From board definition
|
|
Src_Dirs_Root & "/middleware/src/filesystem", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/BLE", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/utils", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/audio", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/monitor", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/bitmap", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/command_line", -- From middleware config
|
|
Src_Dirs_Root & "/middleware/src/sdmmc", -- From middleware config
|
|
Src_Dirs_Root & "/components/src/**", -- From components config
|
|
"config_src/");
|
|
end Native;
|