Skip to content

Commit

Permalink
enable ASAN and source map for debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 19, 2024
1 parent 7dddd87 commit 9730019
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.cache
*.tar.bz2
*.tgz
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-sSIDE_MODULE")
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-sSIDE_MODULE")
add_compile_options(-fPIC -fexceptions)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address -gsource-map)
endif()

set(CMAKE_INSTALL_PREFIX /usr)

set(FIND_ROOT_PATH "${PROJECT_BINARY_DIR}/sysroot/usr")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint:fix": "eslint page --fix",
"check": "tsc --noEmit",
"build": "node scripts/build.mjs",
"prepack": "rm -rf dist && cp -rL preview dist && cp page/Fcitx5.d.ts dist"
"prepack": "scripts/prepack.sh"
},
"license": "AGPL-3.0-or-later",
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions preview/Fcitx5.wasm.map
6 changes: 6 additions & 0 deletions scripts/prepack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -e

rm -rf dist/*
mkdir -p dist
cp -rL preview/{Fcitx5.{data,js,wasm},lib*} dist
cp page/Fcitx5.d.ts dist

0 comments on commit 9730019

Please sign in to comment.