Fix lib.h falling back to TARGET_LINUX during wasm_module and c module compilation
This commit is contained in:
+9
-8
@@ -264,16 +264,17 @@ sub compile_wasm_module {
|
||||
if ( Util::module_is_tacle($module) ) {
|
||||
my ( $srcs, $inc ) = Util::find_tacle_sources($module);
|
||||
Util::run(
|
||||
"$wasi_root/bin/clang", @wasi_cflags,
|
||||
"-Dmain=tacle_main_bullshit", "-I$inc",
|
||||
"targets/wasm-module/$module.cpp", @$srcs,
|
||||
'-o', "$bd/wasm_module.wasm"
|
||||
"$wasi_root/bin/clang", @wasi_cflags,
|
||||
"-Dmain=tacle_main_bullshit", "-DTARGET_WASM",
|
||||
"-I$inc", "targets/wasm-module/$module.cpp",
|
||||
@$srcs, '-o',
|
||||
"$bd/wasm_module.wasm"
|
||||
);
|
||||
}
|
||||
else {
|
||||
Util::run( "$wasi_root/bin/clang", @wasi_cflags,
|
||||
"targets/wasm-module/$module.cpp",
|
||||
'-o', "$bd/wasm_module.wasm" );
|
||||
"-DTARGET_WASM", "targets/wasm-module/$module.cpp",
|
||||
'-o', "$bd/wasm_module.wasm" );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -372,8 +373,8 @@ sub compile_c_module {
|
||||
my ( $module, $bd, $target ) = @_;
|
||||
my ( $cc, @flags ) =
|
||||
( $target eq 'linux' )
|
||||
? ( $linux_cc, @linux_cflags )
|
||||
: ( $cross_cc, @cross_cflags );
|
||||
? ( $linux_cc, @linux_cflags, '-DTARGET_LINUX' )
|
||||
: ( $cross_cc, @cross_cflags, '-DTARGET_FAIL' );
|
||||
|
||||
if ( Util::module_is_tacle($module) ) {
|
||||
my ( $srcs, $inc ) = Util::find_tacle_sources($module);
|
||||
|
||||
Reference in New Issue
Block a user