|
|
|
@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
|
|
|
|
# By default JIT is OFF
|
|
|
|
|
option(LLVM_JIT "Controls whether LLVM JIT compilation will be enabled, default is OFF" OFF)
|
|
|
|
|
option(OMR_JIT "Controls whether NanoJIT compilation will be enabled, default is OFF" OFF)
|
|
|
|
|
option(MIR_JIT "Controls whether MIR JIT compilation will be enabled, default is OFF" ON)
|
|
|
|
|
option(MIR_JIT "Controls whether MIR JIT compilation will be enabled, default is OFF" OFF)
|
|
|
|
|
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(ASM_VM "Controls whether to use the new VM (not ready yet! so don't turn on)" OFF)
|
|
|
|
@ -29,8 +29,12 @@ if (LLVM_JIT OR OMR_JIT OR MIR_JIT)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (MIR_JIT)
|
|
|
|
|
if (MSVC OR WIN32)
|
|
|
|
|
message(FATAL_ERROR "MIR_JIT is not supported when using MSVC and/or WIN32")
|
|
|
|
|
endif()
|
|
|
|
|
set(LLVM_JIT OFF)
|
|
|
|
|
set(OMR_JIT OFF)
|
|
|
|
|
set(STATIC_BUILD ON)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (ASM_VM)
|
|
|
|
@ -81,10 +85,6 @@ if (COMPUTED_GOTO AND MSVC)
|
|
|
|
|
message(WARNING "Computed goto is not available with MSVC")
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (NOT LLVM_JIT AND NOT OMR_JIT)
|
|
|
|
|
message(WARNING "LLVM will not be enabled; specify -DLLVM_JIT=ON to enable")
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "/Od /D_DEBUG /MDd /Zi /RTC1 /EHsc")
|
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /MD /EHsc")
|
|
|
|
@ -380,6 +380,8 @@ endif ()
|
|
|
|
|
|
|
|
|
|
if (NOT STATIC_BUILD)
|
|
|
|
|
set(LIBRAVI_BUILD_TYPE SHARED)
|
|
|
|
|
else()
|
|
|
|
|
set(LIBRAVI_BUILD_TYPE STATIC)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
if (LLVM_JIT)
|
|
|
|
@ -388,7 +390,6 @@ elseif (OMR_JIT)
|
|
|
|
|
set(LIBRAVI_NAME libravilomr)
|
|
|
|
|
elseif (MIR_JIT)
|
|
|
|
|
set(LIBRAVI_NAME libravimir)
|
|
|
|
|
set(LIBRAVI_BUILD_TYPE STATIC)
|
|
|
|
|
else ()
|
|
|
|
|
set(LIBRAVI_NAME libravinojit)
|
|
|
|
|
endif ()
|
|
|
|
@ -436,6 +437,12 @@ add_executable(ravi src/lua.c)
|
|
|
|
|
if (LLVM_JIT)
|
|
|
|
|
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_LLVM=1")
|
|
|
|
|
endif ()
|
|
|
|
|
if (OMR_JIT)
|
|
|
|
|
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_OMRJIT=1")
|
|
|
|
|
endif ()
|
|
|
|
|
if (MIR_JIT)
|
|
|
|
|
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_MIRJIT=1")
|
|
|
|
|
endif ()
|
|
|
|
|
if (EMBEDDED_DMRC)
|
|
|
|
|
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_DMR_C=1")
|
|
|
|
|
endif ()
|
|
|
|
|