chore: explicitly build debug symbols in debug mode, and add gizmo.c/gizmo_glb.c to build
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:native_toolchain_c/native_toolchain_c.dart';
|
|||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
void main(List<String> args) async {
|
void main(List<String> args) async {
|
||||||
|
|
||||||
await build(args, (config, output) async {
|
await build(args, (config, output) async {
|
||||||
var pkgRootFilePath =
|
var pkgRootFilePath =
|
||||||
config.packageRoot.toFilePath(windows: Platform.isWindows);
|
config.packageRoot.toFilePath(windows: Platform.isWindows);
|
||||||
@@ -55,6 +56,7 @@ void main(List<String> args) async {
|
|||||||
var libDir = config.dryRun ? "" : (await getLibDir(config, logger)).path;
|
var libDir = config.dryRun ? "" : (await getLibDir(config, logger)).path;
|
||||||
|
|
||||||
final packageName = config.packageName;
|
final packageName = config.packageName;
|
||||||
|
|
||||||
|
|
||||||
var sources = Directory(path.join(pkgRootFilePath, "native", "src"))
|
var sources = Directory(path.join(pkgRootFilePath, "native", "src"))
|
||||||
.listSync(recursive: true)
|
.listSync(recursive: true)
|
||||||
@@ -73,6 +75,8 @@ void main(List<String> args) async {
|
|||||||
path.join(pkgRootFilePath, "native", "include", "material", "image.c"),
|
path.join(pkgRootFilePath, "native", "include", "material", "image.c"),
|
||||||
path.join(pkgRootFilePath, "native", "include", "material", "grid.c"),
|
path.join(pkgRootFilePath, "native", "include", "material", "grid.c"),
|
||||||
path.join(pkgRootFilePath, "native", "include", "material", "unlit.c"),
|
path.join(pkgRootFilePath, "native", "include", "material", "unlit.c"),
|
||||||
|
path.join(pkgRootFilePath, "native", "include", "material", "gizmo.c"),
|
||||||
|
path.join(pkgRootFilePath, "native", "include", "resources", "gizmo_glb.c"),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var libs = [
|
var libs = [
|
||||||
@@ -153,6 +157,11 @@ void main(List<String> args) async {
|
|||||||
'Cocoa',
|
'Cocoa',
|
||||||
"Metal",
|
"Metal",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (!config.dryRun && config.buildMode == BuildMode.debug) {
|
||||||
|
flags.addAll(["-g", "-O0"]);
|
||||||
|
}
|
||||||
|
|
||||||
libs.addAll(["bluegl", "bluevk"]);
|
libs.addAll(["bluegl", "bluevk"]);
|
||||||
} else if (platform == "android") {
|
} else if (platform == "android") {
|
||||||
libs.addAll(["GLESv3", "EGL", "bluevk", "dl", "android"]);
|
libs.addAll(["GLESv3", "EGL", "bluevk", "dl", "android"]);
|
||||||
@@ -246,32 +255,31 @@ void main(List<String> args) async {
|
|||||||
file: importLib.uri,
|
file: importLib.uri,
|
||||||
architecture: config.targetArchitecture));
|
architecture: config.targetArchitecture));
|
||||||
|
|
||||||
for(final dir in ["windows/vulkan"]) { // , "filament/bluevk", "filament/vulkan"
|
for (final dir in ["windows/vulkan"]) {
|
||||||
final targetSubdir = path
|
// , "filament/bluevk", "filament/vulkan"
|
||||||
.join(config.outputDirectory.path, "include", dir)
|
final targetSubdir =
|
||||||
.substring(1);
|
path.join(config.outputDirectory.path, "include", dir).substring(1);
|
||||||
if (!Directory(targetSubdir).existsSync()) {
|
if (!Directory(targetSubdir).existsSync()) {
|
||||||
Directory(targetSubdir).createSync(recursive: true);
|
Directory(targetSubdir).createSync(recursive: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var file in Directory(path.join(
|
for (var file
|
||||||
pkgRootFilePath, "native", "include", dir))
|
in Directory(path.join(pkgRootFilePath, "native", "include", dir))
|
||||||
.listSync()) {
|
.listSync()) {
|
||||||
if (file is File) {
|
if (file is File) {
|
||||||
final targetPath = path.join(targetSubdir, path.basename(file.path));
|
final targetPath =
|
||||||
file.copySync(targetPath);
|
path.join(targetSubdir, path.basename(file.path));
|
||||||
output.addAsset(NativeCodeAsset(
|
file.copySync(targetPath);
|
||||||
package: config.packageName,
|
output.addAsset(NativeCodeAsset(
|
||||||
name: "include/$dir/${path.basename(file.path)}",
|
package: config.packageName,
|
||||||
linkMode: DynamicLoadingBundled(),
|
name: "include/$dir/${path.basename(file.path)}",
|
||||||
os: config.targetOS,
|
linkMode: DynamicLoadingBundled(),
|
||||||
file: file.uri,
|
os: config.targetOS,
|
||||||
architecture: config.targetArchitecture));
|
file: file.uri,
|
||||||
|
architecture: config.targetArchitecture));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user