@ -2,9 +2,10 @@ const std = @import("std");
pub fn build ( b : * std . Build ) void {
pub fn build ( b : * std . Build ) void {
const optimize = b . standardOptimizeOption ( . { } ) ;
const optimize = b . standardOptimizeOption ( . { } ) ;
const target = b . standardTargetOptions ( . { } ) ;
_ = b . addModule ( " ini " , . {
_ = b . addModule ( " ini " , . {
. source_file = . {
. root_ source_file = . {
. path = " src/ini.zig " ,
. path = " src/ini.zig " ,
} ,
} ,
} ) ;
} ) ;
@ -12,9 +13,10 @@ pub fn build(b: *std.Build) void {
const lib = b . addStaticLibrary ( . {
const lib = b . addStaticLibrary ( . {
. name = " ini " ,
. name = " ini " ,
. root_source_file = . { . path = " src/lib.zig " } ,
. root_source_file = . { . path = " src/lib.zig " } ,
. target = b. s tandardTa rgetOptions( . { } ) ,
. target = target,
. optimize = optimize ,
. optimize = optimize ,
} ) ;
} ) ;
lib . bundle_compiler_rt = true ;
lib . bundle_compiler_rt = true ;
lib . addIncludePath ( . { . path = " src " } ) ;
lib . addIncludePath ( . { . path = " src " } ) ;
lib . linkLibC ( ) ;
lib . linkLibC ( ) ;
@ -24,6 +26,7 @@ pub fn build(b: *std.Build) void {
const example_c = b . addExecutable ( . {
const example_c = b . addExecutable ( . {
. name = " example-c " ,
. name = " example-c " ,
. optimize = optimize ,
. optimize = optimize ,
. target = target ,
} ) ;
} ) ;
example_c . addCSourceFile ( . {
example_c . addCSourceFile ( . {
. file = . {
. file = . {
@ -45,8 +48,9 @@ pub fn build(b: *std.Build) void {
. name = " example-zig " ,
. name = " example-zig " ,
. root_source_file = . { . path = " example/example.zig " } ,
. root_source_file = . { . path = " example/example.zig " } ,
. optimize = optimize ,
. optimize = optimize ,
. target = target ,
} ) ;
} ) ;
example_zig . addModule ( " ini " , b . modules . get ( " ini " ) . ? ) ;
example_zig . root_module. addImport ( " ini " , b . modules . get ( " ini " ) . ? ) ;
b . installArtifact ( example_zig ) ;
b . installArtifact ( example_zig ) ;