Skip to content

Commit ea1557f

Browse files
committed
Using guards to prevent double definitions of std::vector<int>
This is needed for building a monolitic version of openroad's python lib when using bazel Signed-off-by: Felipe Garay <[email protected]>
1 parent 00594d1 commit ea1557f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/par/src/partitionmgr-py.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
namespace std
1515
{
16+
#ifndef SWIG_VECTOR_INT
17+
#define SWIG_VECTOR_INT
1618
%template(vector_int) std::vector<int>;
19+
#endif
1720
%template(vector_float) std::vector<float>;
1821
}
1922
#endif

src/pdn/src/PdnGen-py.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ using namespace pdn;
2929
// before these definitions
3030
namespace std {
3131
%template() std::pair<int, bool>;
32-
#ifndef BAZEL
32+
#ifndef SWIG_VECTOR_INT
33+
#define SWIG_VECTOR_INT
3334
%template(split_cuts_stuff) std::vector<int>;
3435
#endif
3536
%template(stuff) std::array<int, 4>;

src/stt/src/SteinerTreeBuilder-py.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
%include <std_vector.i>
1919

2020
namespace std {
21-
#ifndef BAZEL
21+
#ifndef SWIG_VECTOR_INT
22+
#define SWIG_VECTOR_INT
2223
%template(xy) vector<int>;
2324
#endif
2425
}

0 commit comments

Comments
 (0)