mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-05-30 00:24:12 +08:00
Merge pull request #341 from hzeller/feature-20260407-use-or-readline
Some checks failed
Automatically sync branch from upstream. / Automatic sync 'master' from The-OpenROAD-Project/OpenSTA (push) Has been cancelled
Lint Bazel / Run buildifier format (push) Has been cancelled
Lint Bazel / Run buildifier lint (push) Has been cancelled
CI / build (push) Has been cancelled
Scan Code with pre commit trigger / Security-Scan (push) Has been cancelled
Some checks failed
Automatically sync branch from upstream. / Automatic sync 'master' from The-OpenROAD-Project/OpenSTA (push) Has been cancelled
Lint Bazel / Run buildifier format (push) Has been cancelled
Lint Bazel / Run buildifier lint (push) Has been cancelled
CI / build (push) Has been cancelled
Scan Code with pre commit trigger / Security-Scan (push) Has been cancelled
On bazel: use readline set-up provided by OpenROAD
This commit is contained in:
1
BUILD
1
BUILD
@@ -296,6 +296,7 @@ cc_binary(
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":opensta_lib",
|
||||
"//:tcl_readline_setup",
|
||||
"//bazel:tcl_library_init",
|
||||
"@rules_cc//cc/runfiles",
|
||||
"@tcl_lang//:tcl",
|
||||
|
||||
14
app/Main.cc
14
app/Main.cc
@@ -33,6 +33,7 @@
|
||||
|
||||
#ifdef BAZEL_CURRENT_REPOSITORY
|
||||
#include "bazel/tcl_library_init.h"
|
||||
#include "src/tcl_readline_setup.h"
|
||||
#endif
|
||||
|
||||
#if TCL_READLINE
|
||||
@@ -124,12 +125,18 @@ staTclAppInit(int argc,
|
||||
if (Tcl_Init(interp) == TCL_ERROR)
|
||||
return TCL_ERROR;
|
||||
|
||||
bool has_readline = false;
|
||||
#ifdef BAZEL_CURRENT_REPOSITORY
|
||||
has_readline = (ord::SetupTclReadlineLibrary(interp) == TCL_OK);
|
||||
#endif
|
||||
#if TCL_READLINE
|
||||
if (Tclreadline_Init(interp) == TCL_ERROR)
|
||||
return TCL_ERROR;
|
||||
Tcl_StaticPackage(interp, "tclreadline", Tclreadline_Init, Tclreadline_SafeInit);
|
||||
if (Tcl_EvalFile(interp, TCLRL_LIBRARY "/tclreadlineInit.tcl") != TCL_OK)
|
||||
printf("Failed to load tclreadline.tcl\n");
|
||||
else
|
||||
has_readline = true;
|
||||
#endif
|
||||
|
||||
initStaApp(argc, argv, interp);
|
||||
@@ -167,11 +174,8 @@ staTclAppInit(int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
#if TCL_READLINE
|
||||
return Tcl_Eval(interp, "::tclreadline::Loop");
|
||||
#else
|
||||
return TCL_OK;
|
||||
#endif
|
||||
|
||||
return has_readline ? Tcl_Eval(interp, "::tclreadline::Loop") : TCL_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user