Skip to content

Commit f052087

Browse files
committed
Fix invocation of antlr_target.
Add include/v3x path to target_include_directories. Add debug info to `generate_antlr_parser.py`.
1 parent 8651d86 commit f052087

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

scripts/generate_antlr_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ def generate_antlr_parser(input_folder, output_source_folder, output_include_fol
7171
exit(5)
7272
# Move header files to output include folder
7373
output_files = os.listdir(output_source_folder)
74+
print(f"Moving output include files to {output_include_folder}")
7475
for output_file in output_files:
7576
if output_file.endswith(".h"):
77+
print(f"\t{output_file}")
7678
shutil.move(os.path.join(output_source_folder, output_file), output_include_folder)
7779
except FileNotFoundError as err:
7880
print("Error running java: {}".format(err.strerror))

src/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ set(CQASM_COMMON_SOURCES
109109
add_subdirectory(v3x)
110110

111111
# Generate the lexer and the parser.
112-
function(antlr_target SCRIPT INPUT_DIR OUTPUT_DIR ANTLR_OUTPUTS)
112+
function(antlr_target SCRIPT INPUT_DIR OUTPUT_SRC_DIR OUTPUT_INC_DIR ANTLR_OUTPUTS)
113113
add_custom_command(
114114
OUTPUT ${ANTLR_OUTPUTS}
115-
COMMAND ${Python3_EXECUTABLE} ${SCRIPT} ${INPUT_DIR} ${OUTPUT_DIR}
115+
COMMAND ${Python3_EXECUTABLE} ${SCRIPT} ${INPUT_DIR} ${OUTPUT_SRC_DIR} ${OUTPUT_INC_DIR}
116116
)
117117
endfunction()
118118

@@ -220,6 +220,7 @@ target_include_directories(cqasm-lib-obj
220220
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/"
221221
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include/"
222222
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/../include/"
223+
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/../include/v3x"
223224
PRIVATE "${antlr4-runtime_INCLUDE_DIRS}/"
224225
PRIVATE "${fmt_INCLUDE_DIRS}/"
225226
PRIVATE "${tree-gen_INCLUDE_DIRS}/"

0 commit comments

Comments
 (0)