@@ -75,64 +75,7 @@ pub fn build(b: *std.Build) !void {
75
75
.optimize = optimize ,
76
76
});
77
77
const mod_httpz = httpz .module ("httpz" );
78
-
79
- const ethash = b .addStaticLibrary (.{
80
- .name = "ethash" ,
81
- .optimize = optimize ,
82
- .target = target ,
83
- });
84
- const cflags = [_ ][]const u8 {
85
- "-Wall" , "-O3" , "-fvisibility=hidden" ,
86
- "-fvisibility-inlines-hidden" , "-Wpedantic" , "-Werror" ,
87
- "-Wextra" , "-Wshadow" , "-Wconversion" ,
88
- "-Wsign-conversion" , "-Wno-unknown-pragmas" , "-fno-stack-protector" ,
89
- "-Wimplicit-fallthrough" , "-Wmissing-declarations" , "-Wno-attributes" ,
90
- "-Wextra-semi" , "-fno-exceptions" , "-fno-rtti" ,
91
- "-Wno-deprecated" , // this one is used to remove a warning about char_trait deprecation
92
- "-Wno-strict-prototypes" , // this one is used by glue.c to avoid a warning that does not disappear when the prototype is added.
93
- };
94
- ethash .addCSourceFiles (.{ .root = b .path ("" ), .files = &[_ ][]const u8 {"ethash/lib/keccak/keccak.c" }, .flags = & cflags });
95
- ethash .addIncludePath (b .path ("ethash/include" ));
96
- ethash .linkLibC ();
97
- ethash .linkLibCpp ();
98
- b .installArtifact (ethash );
99
-
100
- const evmone = b .addStaticLibrary (.{
101
- .name = "evmone" ,
102
- .optimize = optimize ,
103
- .target = target ,
104
- });
105
- const cppflags = [_ ][]const u8 {
106
- "-Wall" , "-std=c++20" , "-O3" ,
107
- "-fvisibility=hidden" , "-fvisibility-inlines-hidden" , "-Wpedantic" ,
108
- "-Werror" , "-Wextra" , "-Wshadow" ,
109
- "-Wconversion" , "-Wsign-conversion" , "-Wno-unknown-pragmas" ,
110
- "-fno-stack-protector" , "-Wimplicit-fallthrough" , "-Wmissing-declarations" ,
111
- "-Wno-attributes" , "-Wextra-semi" , "-fno-exceptions" ,
112
- "-fno-rtti" ,
113
- "-Wno-deprecated" , // this one is used to remove a warning about char_trait deprecation
114
- "-DPROJECT_VERSION=\" 0.14.0-dev\" " ,
115
- };
116
- evmone .addCSourceFiles (.{ .root = b .path ("" ), .files = &[_ ][]const u8 {
117
- "evmone/lib/evmone/advanced_analysis.cpp" ,
118
- "evmone/lib/evmone/eof.cpp" ,
119
- "evmone/lib/evmone/advanced_execution.cpp" ,
120
- "evmone/lib/evmone/instructions_calls.cpp" ,
121
- "evmone/lib/evmone/advanced_instructions.cpp" ,
122
- "evmone/lib/evmone/instructions_storage.cpp" ,
123
- "evmone/lib/evmone/baseline.cpp" ,
124
- "evmone/lib/evmone/tracing.cpp" ,
125
- "evmone/lib/evmone/baseline_instruction_table.cpp" ,
126
- "evmone/lib/evmone/vm.cpp" ,
127
- }, .flags = & cppflags });
128
-
129
- evmone .addIncludePath (b .path ("evmone/evmc/include" ));
130
- evmone .addIncludePath (b .path ("evmone/include" ));
131
- evmone .addIncludePath (b .path ("intx/include" ));
132
- evmone .addIncludePath (b .path ("ethash/include" ));
133
- evmone .linkLibC ();
134
- evmone .linkLibCpp ();
135
- b .installArtifact (evmone );
78
+ const zevem = b .dependency ("zevem" , .{ .target = target , .optimize = optimize });
136
79
137
80
const zigcli = b .dependency ("zigcli" , .{});
138
81
@@ -144,19 +87,7 @@ pub fn build(b: *std.Build) !void {
144
87
.target = target ,
145
88
.optimize = optimize ,
146
89
});
147
- exe .addIncludePath (b .path ("evmone/include/evmone" ));
148
- exe .addIncludePath (b .path ("evmone/evmc/include" ));
149
- if (target .result .cpu .arch == .x86_64 ) {
150
- // On x86_64, some functions are missing from the static library,
151
- // so we define dummy functions to make sure that it compiles.
152
- exe .addCSourceFile (.{
153
- .file = b .path ("src/glue.c" ),
154
- .flags = & cflags ,
155
- });
156
- }
157
- exe .linkLibrary (ethash );
158
- exe .linkLibrary (evmone );
159
- exe .linkLibC ();
90
+ exe .root_module .addImport ("zevem" , zevem .module ("zevem" ));
160
91
exe .root_module .addImport ("zig-rlp" , dep_rlp .module ("zig-rlp" ));
161
92
exe .linkLibrary (depSecp256k1 .artifact ("secp256k1" ));
162
93
exe .root_module .addImport ("zig-eth-secp256k1" , mod_secp256k1 );
@@ -199,19 +130,6 @@ pub fn build(b: *std.Build) !void {
199
130
.target = target ,
200
131
.optimize = optimize ,
201
132
});
202
- unit_tests .addIncludePath (b .path ("evmone/include/evmone" ));
203
- unit_tests .addIncludePath (b .path ("evmone/evmc/include" ));
204
- if (target .result .cpu .arch == .x86_64 ) {
205
- // On x86_64, some functions are missing from the static library,
206
- // so we define dummy functions to make sure that it compiles.
207
- unit_tests .addCSourceFile (.{
208
- .file = b .path ("src/glue.c" ),
209
- .flags = & cflags ,
210
- });
211
- }
212
- unit_tests .linkLibrary (ethash );
213
- unit_tests .linkLibrary (evmone );
214
- unit_tests .linkLibC ();
215
133
unit_tests .root_module .addImport ("zig-rlp" , dep_rlp .module ("zig-rlp" ));
216
134
unit_tests .linkLibrary (depSecp256k1 .artifact ("secp256k1" ));
217
135
unit_tests .root_module .addImport ("zig-eth-secp256k1" , mod_secp256k1 );
0 commit comments