Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake of loader and Cable upgrade #75

Merged
merged 4 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
Documentation has been extended.
- Improved: [[#59](https://github.com/ethereum/evmc/pull/59)]
Optional Result Storage helper module has been separated.
- Improved: [[#75](https://github.com/ethereum/evmc/pull/75)]
Cable upgraded to 0.2.11.

## [5.0.0] - 2018-08-10

Expand Down
5 changes: 2 additions & 3 deletions cmake/cable/CableBuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ function(cable_add_buildinfo_library)

# Add buildinfo library under given name.
# Make is static and do not build by default until some other target will actually use it.
add_library(${name} STATIC EXCLUDE_FROM_ALL ${source_file} ${header_file})
add_library(${name} STATIC ${source_file} ${header_file})

target_include_directories(${name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(${name} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
set_target_properties(
${name} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${output_dir}
ARCHIVE_OUTPUT_DIRECTORY ${output_dir}
OUTPUT_NAME buildinfo
)
endfunction()
2 changes: 1 addition & 1 deletion cmake/cable/bootstrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# This is internal variable automaticaly updated with external tools.
# Use CABLE_VERSION variable if you need this information.
set(version 0.2.9)
set(version 0.2.11)

# For conveniance, add the project CMake module dir to module path.
set(module_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Expand Down
14 changes: 9 additions & 5 deletions cmake/cable/buildinfo/buildinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

string(TOLOWER ${SYSTEM_NAME} SYSTEM_NAME)
string(TOLOWER ${SYSTEM_PROCESSOR} SYSTEM_PROCESSOR)
string(TOLOWER ${COMPILER_ID} COMPILER_ID)
string(TOLOWER ${BUILD_TYPE} BUILD_TYPE)
string(TOLOWER "${SYSTEM_NAME}" SYSTEM_NAME)
string(TOLOWER "${SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR)
string(TOLOWER "${COMPILER_ID}" COMPILER_ID)
string(TOLOWER "${BUILD_TYPE}" BUILD_TYPE)
string(TIMESTAMP TIMESTAMP)

# Read the git info from a file. The gitinfo is suppose to update the file
Expand Down Expand Up @@ -45,7 +45,11 @@ if(GIT_COMMIT_HASH)
endif()
endif()

if(${PROJECT_VERSION} STREQUAL "${GIT_LATEST_PROJECT_VERSION}")
if(NOT PROJECT_VERSION)
message(WARNING "PROJECT_VERSION not specified")
endif()

if(PROJECT_VERSION STREQUAL GIT_LATEST_PROJECT_VERSION)
if(${GIT_LATEST_PROJECT_VERSION_DISTANCE} GREATER 0)
set(PROJECT_VERSION "${PROJECT_VERSION}-${GIT_LATEST_PROJECT_VERSION_DISTANCE}${version_commit}")
endif()
Expand Down
12 changes: 12 additions & 0 deletions cmake/cable/toolchains/cxx11-fpic.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_CXX_FLAGS_INIT "-fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_INIT "-fPIC" CACHE STRING "" FORCE)
9 changes: 9 additions & 0 deletions cmake/cable/toolchains/cxx11-pic.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Cable: CMake Bootstrap Library.
# Copyright 2018 Pawel Bylica.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
12 changes: 7 additions & 5 deletions lib/loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ add_library(
)

add_library(evmc::loader ALIAS loader)
set_target_properties(loader PROPERTIES OUTPUT_NAME evmc-loader)
target_include_directories(loader PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
set_target_properties(loader PROPERTIES
OUTPUT_NAME evmc-loader
POSITION_INDEPENDENT_CODE TRUE
)
target_include_directories(loader PUBLIC
$<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(loader INTERFACE ${CMAKE_DL_LIBS})
if(BUILD_SHARED_LIBS)
set_target_properties(loader PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()

install(TARGETS loader EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})