Skip to content

Commit

Permalink
cmake: Build evmone-standalone library on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 17, 2019
1 parent 49a47fd commit 3235bcf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,20 @@ endif()
# INSTALL

set(install_targets evmone)
if(TARGET evmone-standalone)
list(APPEND install_targets evmone-standalone)
endif()
if(TARGET evm-test)
list(APPEND install_targets evm-test)
endif()

set_target_properties(
${install_targets} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}
)

install(TARGETS ${install_targets} EXPORT evmoneTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
10 changes: 4 additions & 6 deletions lib/evmone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.

include(LibraryTools)

hunter_add_package(intx)
find_package(intx CONFIG REQUIRED)

Expand All @@ -24,10 +26,6 @@ if(NOT SANITIZE)
target_link_options(evmone PRIVATE $<$<PLATFORM_ID:Linux>:LINKER:--no-undefined>)
endif()

set_target_properties(
evmone PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}
)
set_source_files_properties(evmone.cpp PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")

add_standalone_library(evmone)

0 comments on commit 3235bcf

Please sign in to comment.