Skip to content

Commit

Permalink
feat(build): add QUICK_LINT_JS_FEATURE_EXTRA_DEBUG
Browse files Browse the repository at this point in the history
The QLJS_DEBUG macro is used in a few places but is not set by a build
system knob. Add QUICK_LINT_JS_FEATURE_EXTRA_DEBUG which, when
enabled, causes QLJS_SLOW_ASSERT and other things to activate.
  • Loading branch information
strager committed Nov 4, 2023
1 parent 67da3d4 commit b0b2007
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- {runs_on: ubuntu-latest, name: "GCC 10 ASAN+UBSAN", container: "ghcr.io/quick-lint/quick-lint-js-github-gcc:v1", CC: gcc-10, CXX: g++-10, CFLAGS: "-fsanitize=address,undefined -fsanitize-address-use-after-scope -fno-sanitize-recover=address,undefined -fuse-ld=gold", CMAKE_BUILD_TYPE: "Debug", WARNINGS: "-Werror;{0}", CMAKE_FLAGS: "-G Ninja", ASAN_OPTIONS: "strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"}
- {runs_on: ubuntu-latest, name: "GCC 10 Release", container: "ghcr.io/quick-lint/quick-lint-js-github-gcc:v1", CC: gcc-10, CXX: g++-10, CFLAGS: "", CMAKE_BUILD_TYPE: "Release", WARNINGS: "-Werror;{0}"}
# TODO(strager): Enable Ninja for this job.
- {runs_on: ubuntu-latest, name: "GCC 10 dev", container: "ghcr.io/quick-lint/quick-lint-js-github-gcc:v1", CC: gcc-10, CXX: g++-10, CFLAGS: "", CMAKE_BUILD_TYPE: "Debug", WARNINGS: "-Werror;{0}", CMAKE_FLAGS: "-DQUICK_LINT_JS_FEATURE_DEBUG_SERVER=ON -DQUICK_LINT_JS_FEATURE_VECTOR_PROFILING=ON"}
- {runs_on: ubuntu-latest, name: "GCC 10 dev", container: "ghcr.io/quick-lint/quick-lint-js-github-gcc:v1", CC: gcc-10, CXX: g++-10, CFLAGS: "", CMAKE_BUILD_TYPE: "Debug", WARNINGS: "-Werror;{0}", CMAKE_FLAGS: "-DQUICK_LINT_JS_FEATURE_DEBUG_SERVER=ON -DQUICK_LINT_JS_FEATURE_EXTRA_DEBUG=ON -DQUICK_LINT_JS_FEATURE_VECTOR_PROFILING=ON"}
# TODO(strager): Also test MinGW-based builds.
- {runs_on: windows-latest, name: "MSVC", CFLAGS: "", CMAKE_BUILD_TYPE: "Debug", WARNINGS: ""}
- {runs_on: windows-latest, name: "MSVC Release", CFLAGS: "", CMAKE_BUILD_TYPE: "Release", WARNINGS: ""}
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ option(
"Enable the HTTP monitoring server at run-time"
FALSE
)
option(
QUICK_LINT_JS_FEATURE_EXTRA_DEBUG
"Enable extra slow debug checking at run-time"
FALSE
)
option(
QUICK_LINT_JS_FEATURE_VECTOR_PROFILING
"Enable the QLJS_DUMP_VECTORS option at run-time"
Expand All @@ -147,6 +152,9 @@ quick_lint_js_disable_unwanted_warnings()
if (WIN32)
add_definitions(-D_WIN32_WINNT=0x0602)
endif ()
if (QUICK_LINT_JS_FEATURE_EXTRA_DEBUG)
add_compile_definitions(QLJS_DEBUG)
endif ()

# HACK(strager): Work around issues with CI. We should consider using
# find_package(Python3) instead.
Expand Down

0 comments on commit b0b2007

Please sign in to comment.