|
|
|
@ -12,7 +12,7 @@ option(STATIC_BUILD "Build static version of Ravi, default is OFF" OFF)
|
|
|
|
|
option(COMPUTED_GOTO "Controls whether the interpreter switch will use computed gotos on gcc/clang, default is ON" ON)
|
|
|
|
|
option(LTESTS "Controls whether ltests are enabled in Debug mode; note requires Debug build" ON)
|
|
|
|
|
option(ASAN "Controls whether address sanitizer should be enabled" OFF)
|
|
|
|
|
option(RAVICOMP "Controls whether to link in RaviComp" ON)
|
|
|
|
|
option(RAVICOMP "Controls whether to link in RaviComp" OFF)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
|
|
|
|
|
|
|
|
@ -83,15 +83,15 @@ endif ()
|
|
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
|
check_c_compiler_flag("-march=native" COMPILER_OPT_ARCH_NATIVE_SUPPORTED)
|
|
|
|
|
if (COMPILER_OPT_ARCH_NATIVE_SUPPORTED AND NOT CMAKE_C_FLAGS MATCHES "-march=")
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
|
|
|
|
endif()
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
|
|
|
|
endif ()
|
|
|
|
|
if (ASAN)
|
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
|
|
|
|
|
check_c_compiler_flag("-fsanitize=address" COMPILER_ASAN_SUPPORTED)
|
|
|
|
|
if (COMPILER_ASAN_SUPPORTED AND NOT CMAKE_C_FLAGS_DEBUG MATCHES "-fsanitize=address")
|
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (LLVM_JIT)
|
|
|
|
|
find_package(LLVM REQUIRED CONFIG)
|
|
|
|
@ -135,26 +135,28 @@ else ()
|
|
|
|
|
# CLion seems unable to handle include paths set on sources
|
|
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/mir;${CMAKE_SOURCE_DIR}/mir/c2mir")
|
|
|
|
|
endif ()
|
|
|
|
|
else()
|
|
|
|
|
else ()
|
|
|
|
|
set(JIT_SRCS ${NO_JIT_SRCS})
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (RAVICOMP AND MIR_JIT)
|
|
|
|
|
if (RAVICOMP)
|
|
|
|
|
# Need MIR_JIT for the compiler add-on
|
|
|
|
|
find_package(RaviComp REQUIRED)
|
|
|
|
|
set(ADDON_SRCS ${RAVICOMP_SRCS})
|
|
|
|
|
set_property(SOURCE ${RAVICOMP_SRCS}
|
|
|
|
|
APPEND
|
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES ${RAVICOMP_INCLUDE_DIRS})
|
|
|
|
|
set_property(SOURCE ${RAVICOMP_SRCS}
|
|
|
|
|
APPEND
|
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/mir;${CMAKE_SOURCE_DIR}/mir/c2mir")
|
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES ${RAVICOMP_INCLUDE_DIRS})
|
|
|
|
|
if (MIR_JIT)
|
|
|
|
|
set_property(SOURCE ${RAVICOMP_SRCS}
|
|
|
|
|
APPEND
|
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/mir;${CMAKE_SOURCE_DIR}/mir/c2mir")
|
|
|
|
|
endif ()
|
|
|
|
|
if ($ENV{CLION_IDE})
|
|
|
|
|
# CLion seems unable to handle include paths set on sources
|
|
|
|
|
include_directories(${RAVICOMP_INCLUDE_DIRS})
|
|
|
|
|
endif ()
|
|
|
|
|
endif()
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
# IDE stuff
|
|
|
|
|
if (MSVC OR APPLE)
|
|
|
|
@ -310,7 +312,7 @@ if (RAVICOMP)
|
|
|
|
|
APPEND
|
|
|
|
|
PROPERTY COMPILE_DEFINITIONS "USE_RAVICOMP=1")
|
|
|
|
|
set(USE_RAVICOMP 1)
|
|
|
|
|
endif()
|
|
|
|
|
endif ()
|
|
|
|
|
if (APPLE)
|
|
|
|
|
set_property(
|
|
|
|
|
TARGET ${LIBRAVI_NAME} libravinojit_static
|
|
|
|
|