Skip to content

Commit d3b01d7

Browse files
committed
WIP
1 parent ccc510e commit d3b01d7

File tree

15 files changed

+120
-70
lines changed

15 files changed

+120
-70
lines changed

.vscode/launch.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"name": "test-node",
9+
"type": "node",
10+
"request": "launch",
11+
"cwd": "${workspaceFolder}",
12+
"runtimeArgs": [
13+
"run-script",
14+
"test-node"
15+
],
16+
"runtimeExecutable": "npm",
17+
"skipFiles": [
18+
"<node_internals>/**"
19+
],
20+
"outFiles": [
21+
"${workspaceFolder}/packages/**/*.js",
22+
"${workspaceFolder}/packages/**/*.c",
23+
"!**/node_modules/**"
24+
],
25+
},
726
{
827
"name": "index-browser",
928
"type": "msedge",
@@ -75,24 +94,6 @@
7594
"webpack:///*": "/*"
7695
},
7796
},
78-
{
79-
"name": "test-node",
80-
"type": "node",
81-
"request": "launch",
82-
"runtimeArgs": [
83-
"run-script",
84-
"test-node"
85-
],
86-
"runtimeExecutable": "npm",
87-
"skipFiles": [
88-
"<node_internals>/**"
89-
],
90-
"outFiles": [
91-
"${workspaceFolder}/**/*.js",
92-
"${workspaceFolder}/**/*.c",
93-
"!**/node_modules/**"
94-
],
95-
},
9697
{
9798
"name": "esbuild",
9899
"type": "node",

.vscode/tasks.json

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
42
"version": "2.0.0",
53
"tasks": [
64
{
75
"type": "npm",
8-
"label": "Compile Types Watch",
9-
"script": "compile-types-watch",
6+
"label": "build-types-watch",
7+
"script": "build-types-watch",
108
"problemMatcher": [
119
"$tsc-watch"
1210
],
@@ -16,9 +14,48 @@
1614
},
1715
{
1816
"type": "npm",
19-
"label": "Compile TypeScript Watch",
20-
"script": "compile-ts-watch",
21-
"problemMatcher": [],
17+
"label": "build-ts-watch",
18+
"script": "build-ts-watch",
19+
"problemMatcher": [
20+
"$tsc-watch"
21+
],
22+
"presentation": {
23+
"group": "group-build"
24+
}
25+
},
26+
{
27+
"type": "npm",
28+
"label": "build-cpp",
29+
"script": "build-cpp",
30+
"problemMatcher": [
31+
"$gcc"
32+
],
33+
"presentation": {
34+
"group": "group-build"
35+
}
36+
},
37+
{
38+
"type": "npm",
39+
"label": "build-cpp-watch",
40+
"script": "build-cpp-watch",
41+
"dependsOn": [
42+
"build-cpp"
43+
],
44+
"problemMatcher": {
45+
"owner": "cpp",
46+
"fileLocation": [
47+
"relative",
48+
"${workspaceFolder}"
49+
],
50+
"pattern": {
51+
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
52+
"file": 1,
53+
"line": 2,
54+
"column": 3,
55+
"severity": 4,
56+
"message": 5
57+
}
58+
},
2259
"presentation": {
2360
"group": "group-build"
2461
}
@@ -27,23 +64,21 @@
2764
"type": "npm",
2865
"label": "Web Server",
2966
"script": "serve",
30-
"problemMatcher": [],
3167
"presentation": {
3268
"group": "group-build"
3369
}
3470
},
3571
{
3672
"label": "build",
3773
"dependsOn": [
38-
"Compile Types Watch",
39-
"Compile TypeScript Watch",
40-
"Web Server"
74+
"build-types-watch",
75+
"build-ts-watch",
76+
"build-cpp-watch"
4177
],
4278
"group": {
4379
"kind": "build",
4480
"isDefault": true
45-
},
46-
"problemMatcher": []
81+
}
4782
}
4883
]
4984
}

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ set(CMAKE_INSTALL_PREFIX "..")
88
set(VCPKG_INCLUDE_DIR ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)
99

1010
# See: https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
11-
set(EM_CPP_FLAGS "")
11+
set(EM_CPP_FLAGS
12+
"-flto"
13+
)
1214

1315
set(EM_LINK_FLAGS
1416
"-sASSERTIONS=0"
@@ -40,7 +42,7 @@ set(EM_LINK_FLAGS
4042
"--post-js ${CMAKE_CURRENT_SOURCE_DIR}/src-cpp/src/post.js"
4143
)
4244

43-
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
45+
if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
4446
set(EM_LINK_FLAGS
4547
${EM_LINK_FLAGS}
4648
"-sUSE_ES6_IMPORT_META=1"

CMakePresets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
{
1313
"name": "vcpkg-emscripten",
14+
"hidden": true,
1415
"inherits": [
1516
"vcpkg"
1617
],
@@ -31,6 +32,16 @@
3132
"CMAKE_BUILD_TYPE": "Debug"
3233
}
3334
},
35+
{
36+
"name": "vcpkg-emscripten-RelWithDebInfo",
37+
"inherits": [
38+
"vcpkg-emscripten"
39+
],
40+
"binaryDir": "${sourceDir}/build",
41+
"cacheVariables": {
42+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
43+
}
44+
},
3445
{
3546
"name": "vcpkg-emscripten-MinSizeRel",
3647
"inherits": [

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
"build-cpp:linux": "./scripts/cpp-build.sh",
4545
"build-cpp:win32": "wsl -e ./scripts/cpp-build.sh",
4646
"build-cpp-watch": "chokidar 'packages/*/src-cpp/**/*' -c 'npm run build-cpp'",
47+
"build-types-watch": "lerna run build-types-watch",
48+
"build-ts-dev": "lerna run build-ts-dev",
49+
"build-ts-watch": "lerna run build-ts-watch",
4750
"build-docs-vitepress": "vitepress build docs",
4851
"build-docs": "run-s pack-duckdb gen-docs build-docs-vitepress copy-res",
4952
"build-docs-watch": "vitepress dev docs",

packages/base91/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build-types": "tsc --project tsconfig.json --emitDeclarationOnly",
2222
"build-types-watch": "npm run build-types -- --watch",
2323
"build-ts": "node esbuild.mjs",
24-
"build-ts-dev": "npm run build-ts -- --mode=development",
25-
"build-ts-watch": "npm run compile-ts-dev -- --watch",
24+
"build-ts-dev": "npm run build-ts -- --development",
25+
"build-ts-watch": "npm run build-ts-dev -- --watch",
2626
"build-dev": "run-p build-types build-ts-dev",
2727
"build": "run-p build-types build-ts",
2828
"lint-skypack": "npx -y @skypack/package-check",

packages/duckdb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"build-types": "tsc --project tsconfig.json --emitDeclarationOnly",
2626
"build-types-watch": "npm run build-types -- --watch",
2727
"build-ts": "node esbuild.mjs",
28-
"build-ts-dev": "npm run build-ts -- --mode=development",
29-
"build-ts-watch": "npm run compile-ts-dev -- --watch",
28+
"build-ts-dev": "npm run build-ts -- --development",
29+
"build-ts-watch": "npm run build-ts-dev -- --watch",
3030
"build-dev": "run-p build-types build-ts-dev",
3131
"build": "npm-run-all --serial pack-duckdb --parallel build-types build-ts",
3232
"lint-skypack": "npx -y @skypack/package-check",

packages/expat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build-types": "tsc --project tsconfig.json --emitDeclarationOnly",
2222
"build-types-watch": "npm run build-types -- --watch",
2323
"build-ts": "node esbuild.mjs",
24-
"build-ts-dev": "npm run build-ts -- --mode=development",
25-
"build-ts-watch": "npm run compile-ts-dev -- --watch",
24+
"build-ts-dev": "npm run build-ts -- --development",
25+
"build-ts-watch": "npm run build-ts-dev -- --watch",
2626
"build-dev": "run-p build-types build-ts-dev",
2727
"build": "run-p build-types build-ts",
2828
"lint-skypack": "npx -y @skypack/package-check",

packages/graphviz/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"build-types": "tsc --project tsconfig.json --emitDeclarationOnly",
2222
"build-types-watch": "npm run build-types -- --watch",
2323
"build-ts": "node esbuild.mjs",
24-
"build-ts-dev": "npm run build-ts -- --mode=development",
25-
"build-ts-watch": "npm run compile-ts-dev -- --watch",
24+
"build-ts-dev": "npm run build-ts -- --development",
25+
"build-ts-watch": "npm run build-ts-dev -- --watch",
2626
"build-dev": "run-p build-types build-ts-dev",
2727
"build": "run-p build-types build-ts",
2828
"lint-skypack": "npx -y @skypack/package-check",

packages/llama/src-cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ find_package(Llama CONFIG REQUIRED)
88

99
set(EM_CPP_FLAGS
1010
${EM_CPP_FLAGS}
11+
"-msimd128"
1112
"-fwasm-exceptions"
1213
)
1314
string(REPLACE ";" " " CPP_FLAGS "${EM_CPP_FLAGS}")

0 commit comments

Comments
 (0)