@@ -853,23 +853,31 @@ fn buildCurl(b: *Build, m: *Build.Module) !void {
853853
854854pub fn buildAda (b : * Build , m : * Build.Module ) ! void {
855855 const ada_dep = b .dependency ("ada-singleheader" , .{});
856- const dep_root = ada_dep .path ("" );
857856
858- // Private module that binds ada functions.
859857 const ada_mod = b .createModule (.{
860858 .root_source_file = b .path ("vendor/ada/root.zig" ),
861- .target = m .resolved_target ,
862- .optimize = m .optimize ,
863859 });
864860
865- // Expose headers; note that "ada.h" is a C++ header so no use here.
866- ada_mod .addIncludePath (dep_root );
861+ const ada_lib = b .addLibrary (.{
862+ .name = "ada" ,
863+ .root_module = b .createModule (.{
864+ .link_libcpp = true ,
865+ .target = m .resolved_target ,
866+ .optimize = m .optimize ,
867+ }),
868+ .linkage = .static ,
869+ });
867870
868- ada_mod . addCSourceFiles (.{
869- .root = dep_root ,
870- .files = &.{"ada.cpp" },
871- .flags = &.{ "-std=c++20" } ,
871+ ada_lib . addCSourceFile (.{
872+ .file = ada_dep . path ( "ada.cpp" ) ,
873+ .flags = &.{ "-std=c++20" , "-O3" },
874+ .language = .cpp ,
872875 });
873876
877+ ada_lib .installHeader (ada_dep .path ("ada_c.h" ), "ada_c.h" );
878+
879+ // Link the library to ada module.
880+ ada_mod .linkLibrary (ada_lib );
881+ // Expose ada module to main module.
874882 m .addImport ("ada" , ada_mod );
875883}
0 commit comments