You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
681 B
24 lines
681 B
cmake_minimum_required(VERSION 3.21)
|
|
option(BUILD_IR_TESTING "Build IR testing" OFF)
|
|
|
|
project(CarrotCompiler VERSION 0.1
|
|
DESCRIPTION "Simple compiler targeted armv7 for SysY Language"
|
|
LANGUAGES CXX)
|
|
# 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")
|
|
include_directories(${INCLUDE_DIRECTORIES})
|
|
|
|
# Compiler sources
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
|
add_subdirectory(src)
|
|
|
|
# Unit tests
|
|
include(CTest)
|
|
if(BUILD_TESTING)
|
|
add_subdirectory(runtime)
|
|
endif(BUILD_TESTING) |