|
|
@ -29,40 +29,9 @@ else() |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
set(EVMJIT_VERSION "0.0.0") |
|
|
|
set(EVMJIT_VERSION_MAJOR 0) |
|
|
|
set(EVMJIT_VERSION_MINOR 0) |
|
|
|
set(EVMJIT_VERSION_PATCH 0) |
|
|
|
set(EVMJIT_VERSION_FULL "v0.0.0-nogit") |
|
|
|
|
|
|
|
find_package(Git) |
|
|
|
if(GIT_FOUND) |
|
|
|
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR} describe --dirty --always --match v* |
|
|
|
OUTPUT_VARIABLE EVMJIT_VERSION_FULL OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
|
|
endif() |
|
|
|
|
|
|
|
if(${EVMJIT_VERSION_FULL} MATCHES "^v[0-9]+\\.[0-9]+") |
|
|
|
string(SUBSTRING ${EVMJIT_VERSION_FULL} 1 -1 EVMJIT_VERSION_FULL) # skip "v" |
|
|
|
string(REPLACE "-" ";" VERSION_COMPONENTS ${EVMJIT_VERSION_FULL}) |
|
|
|
list(LENGTH VERSION_COMPONENTS NUM_VERSION_COMPONENTS) |
|
|
|
list(GET VERSION_COMPONENTS 0 EVMJIT_VERSION) |
|
|
|
string(REPLACE "." ";" VERSION_NUMBERS ${EVMJIT_VERSION}) |
|
|
|
list(LENGTH VERSION_NUMBERS NUM_VERSION_NUMBERS) |
|
|
|
list(GET VERSION_NUMBERS 0 EVMJIT_VERSION_MAJOR) |
|
|
|
list(GET VERSION_NUMBERS 1 EVMJIT_VERSION_MINOR) |
|
|
|
if(${NUM_VERSION_NUMBERS} GREATER 2) |
|
|
|
list(GET VERSION_NUMBERS 2 EVMJIT_VERSION_PATCH) # patch number is optional |
|
|
|
endif() |
|
|
|
if(${NUM_VERSION_COMPONENTS} GREATER 1) |
|
|
|
list(GET VERSION_COMPONENTS 1 VERSION_PRERELEASE_CANDIDATE) |
|
|
|
string(REGEX MATCH "^[a-zA-Z]+.*" EVMJIT_VERSION_PRERELEASE ${VERSION_PRERELEASE_CANDIDATE}) # prerelease starts with letter |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
if(${EVMJIT_VERSION_MAJOR} EQUAL 0) |
|
|
|
set(EVMJIT_SOVERSION "0.${EVMJIT_VERSION_MINOR}") |
|
|
|
else() |
|
|
|
else() |
|
|
|
set(EVMJIT_SOVERSION ${EVMJIT_VERSION_MAJOR}) |
|
|
|
endif() |
|
|
|
|
|
|
@ -70,10 +39,10 @@ endif() |
|
|
|
string(COMPARE EQUAL "${LLVM_ENABLE_ASSERTIONS}" "ON" LLVM_DEBUG) |
|
|
|
configure_file(BuildInfo.h.in ${CMAKE_CURRENT_BINARY_DIR}/gen/BuildInfo.gen.h) |
|
|
|
|
|
|
|
message(STATUS "EVM JIT version: ${EVMJIT_VERSION_MAJOR}.${EVMJIT_VERSION_MINOR}.${EVMJIT_VERSION_PATCH} ${EVMJIT_VERSION_PRERELEASE} (${EVMJIT_VERSION_FULL})") |
|
|
|
message(STATUS "EVM JIT version: ${EVMJIT_VERSION_MAJOR}.${EVMJIT_VERSION_MINOR}.${EVMJIT_VERSION_PATCH}") |
|
|
|
|
|
|
|
add_library(${TARGET_NAME} SHARED ${SOURCES} gen/BuildInfo.gen.h) |
|
|
|
set_target_properties(${TARGET_NAME} PROPERTIES |
|
|
|
set_target_properties(${TARGET_NAME} PROPERTIES |
|
|
|
VERSION ${EVMJIT_VERSION} SOVERSION ${EVMJIT_SOVERSION} |
|
|
|
FOLDER "libs") |
|
|
|
|
|
|
|