Commit b938d3dd authored by YZK's avatar YZK
Browse files

fix: Cmake IR compilation

No related merge requests found
Showing with 5 additions and 1 deletion
+5 -1
......@@ -7,6 +7,7 @@ project(CarrotCompiler VERSION 0.1
# Common build options
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
# set(BUILD_IR_TESTING true)
# Generic includes
set(INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/include")
......
......@@ -14,7 +14,7 @@ set(SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/sylib.c")
if(BUILD_IR_TESTING)
add_custom_target(sysy-ir ALL
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}
COMMAND clang ${CMAKE_C_FLAGS}
-I ${INCLUDE_DIRECTORY}
-S -emit-llvm
${SOURCE_FILES}
......
......@@ -8,6 +8,9 @@ set(PERFORMANCE_TESTS_DIR
set(FINAL_PERFORMANCE_TESTS_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/case/final_performance")
# set(BUILD_PERFORMANCE_TESTS true)
# set(BUILD_IR_TESTING true)
# Define test function
function(add_test_dir testdir)
file(GLOB files "${testdir}/*.sy")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment