Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 5d5965c

Browse files
authored
Merge pull request #216 from mingzhe09088/fix-tc-lang-fb
Fix tc_lang runtime error in FBcode
2 parents addd4d2 + 3d53633 commit 5d5965c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ message(STATUS "CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX}")
2727

2828
add_subdirectory(third-party/pybind11)
2929

30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTC_DIR=\"\\\"$ENV{TC_DIR}\\\"\" ")
31+
3032
set(LLVM_DIR ${CLANG_PREFIX}/lib/cmake/llvm)
3133
message(STATUS "Looking for LLVM in ${LLVM_DIR}")
3234
find_package(LLVM REQUIRED LLVM)

include/tc/lang/tree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <functional>
1919
#include <memory>
20+
#include <sstream>
2021
#include <vector>
2122

2223
#include "tc/lang/lexer.h"

test/test_lang.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929

3030
using namespace lang;
3131

32-
const std::string expected_file_path = "src/lang/test_expected/";
32+
#ifndef TC_DIR
33+
#error "TC_DIR must be defined"
34+
#endif
35+
36+
const std::string expected_file_path =
37+
std::string(TC_DIR) + "/src/lang/test_expected/";
3338

3439
static inline void barf(const char* fmt, ...) {
3540
char msg[2048];

0 commit comments

Comments
 (0)