Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core,developer): use NDEBUG flag to disable assertions in release build #12715

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion common/windows/delphi/general/KeymanPaths.pas
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,18 @@ class function TKeymanPaths.RunningFromSource(var keyman_root: string): Boolean;
class function TKeymanPaths.KeymanCoreLibraryPath(const Filename: string): string;
var
keyman_root: string;
configuration: string;
begin
// Look up KEYMAN_ROOT development variable -- if found and executable
// within that path then use that as source path
if TKeymanPaths.RunningFromSource(keyman_root) then
begin
Exit(keyman_root + 'core\build\x86\debug\src\' + Filename);
{$IFDEF DEBUG}
configuration := 'debug';
{$ELSE}
configuration := 'release';
{$ENDIF}
Exit(keyman_root + 'core\build\x86\'+configuration+'\src\' + Filename);
Comment on lines +445 to +450
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows us to test both release and debug builds of Core in the Debugger when running within the keymanapp/keyman repo

end;

Result := GetDebugPath('KeymanCoreLibraryPath', '');
Expand Down
6 changes: 6 additions & 0 deletions resources/build/meson/standard.meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ if cpp_compiler.get_id() == 'msvc'
'-D_SCL_SECURE_NO_WARNINGS',
'-D_CRT_SECURE_NO_WARNINGS'
]
if get_option('buildtype') != 'debug'
# Disable assertions on release builds
defns += [
'-DNDEBUG'
]
endif
endif

if cpp_compiler.get_id() == 'emscripten'
Expand Down