Skip to content

Commit 12bbfed

Browse files
authored
Merge pull request #335 from hzeller/feature-20260405-init-tcl
Use same tcl initialization as in OpenROAD
2 parents f54e2ae + 4662230 commit 12bbfed

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ cc_binary(
272272
"app/Main.cc",
273273
":StaApp",
274274
":StaTclInitVar",
275-
"//bazel:runfiles",
276275
],
277276
copts = [
278277
"-Wno-error",
@@ -297,6 +296,7 @@ cc_binary(
297296
visibility = ["//visibility:public"],
298297
deps = [
299298
":opensta_lib",
299+
"//bazel:tcl_library_init",
300300
"@rules_cc//cc/runfiles",
301301
"@tcl_lang//:tcl",
302302
],

app/Main.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
#include <filesystem>
3131
#include <string_view>
3232
#include <tcl.h>
33+
34+
#ifdef BAZEL_CURRENT_REPOSITORY
35+
#include "bazel/tcl_library_init.h"
36+
#endif
37+
3338
#if TCL_READLINE
3439
#include <tclreadline.h>
3540
#endif
@@ -109,6 +114,12 @@ staTclAppInit(int argc,
109114
std::string_view init_filename,
110115
Tcl_Interp *interp)
111116
{
117+
#ifdef BAZEL_CURRENT_REPOSITORY
118+
if (in_bazel::SetupTclEnvironment(interp) == TCL_ERROR) {
119+
return TCL_ERROR;
120+
}
121+
#endif
122+
112123
// source init.tcl
113124
if (Tcl_Init(interp) == TCL_ERROR)
114125
return TCL_ERROR;

0 commit comments

Comments
 (0)