Ada: gnat gprbuild How to link in libraries?

后端 未结 2 1667
陌清茗
陌清茗 2021-01-14 06:31

In this multi-language GPRBuild project I\'m working on, I have some c++ library files (*.a) I need to link into my executable. Is there an gpr attribute to tell it what to

相关标签:
2条回答
  • 2021-01-14 06:45

    Or even better:

    Project my_library is
      For externally_built use "true";
      For library_dir use "/where/ever";
      For library_name use "mylibname";
      For source_dirs use (); -- no sources.
      For library_kind use "static";
      -- if it is a static lib .a
    
      -- for library_kind use "dynamic";
      -- if it is an so.
    End my_library;
    

    And in the application project. With "my_library.gpr";

    0 讨论(0)
  • 2021-01-14 07:12

    Within the main project file,

    package Linker is
       for Default_Switches ("Ada") use ("-L/where/ever", "-lbar");
    end Linker;
    
    0 讨论(0)
提交回复
热议问题