cmake: Drop evmc- prefix from example VM targets

This commit is contained in:
Paweł Bylica 2019-11-04 16:35:02 +01:00
parent 42e73b0de3
commit 7b38c1da2d
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
6 changed files with 17 additions and 13 deletions

View File

@ -33,7 +33,7 @@ commands:
# Test statically linked end-to-end example
~/build/examples/evmc-example-static
# Test dynamically loaded end-to-end example
~/build/examples/evmc-example ~/build/examples/example_vm/libevmc-example-vm.so
~/build/examples/evmc-example ~/build/examples/example_vm/libexample-vm.so
- run:
name: "Install"
command: cmake --build ~/build --target install

View File

@ -17,7 +17,7 @@ add_library(evmc-example-host STATIC example_host.cpp)
target_link_libraries(evmc-example-host PRIVATE evmc)
add_executable(evmc-example-static example.c)
target_link_libraries(evmc-example-static PRIVATE evmc-example-host evmc-example-vm-static evmc)
target_link_libraries(evmc-example-static PRIVATE evmc-example-host evmc::example-vm-static evmc)
target_compile_definitions(evmc-example-static PRIVATE STATICALLY_LINKED_EXAMPLE)
add_executable(evmc-example example.c)

View File

@ -2,13 +2,15 @@
# Copyright 2019 The EVMC Authors.
# Licensed under the Apache License, Version 2.0.
add_library(evmc-example-precompiles-vm SHARED example_precompiles_vm.cpp)
target_link_libraries(evmc-example-precompiles-vm PRIVATE evmc)
add_library(example-precompiles-vm SHARED example_precompiles_vm.cpp)
add_library(evmc::example-precompiles-vm ALIAS example-precompiles-vm)
target_link_libraries(example-precompiles-vm PRIVATE evmc)
set_source_files_properties(example_precompiles_vm.cpp PROPERTIES
COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
if(EVMC_INSTALL)
install(TARGETS evmc-example-precompiles-vm
install(TARGETS example-precompiles-vm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

View File

@ -2,17 +2,19 @@
# Copyright 2019 The EVMC Authors.
# Licensed under the Apache License, Version 2.0.
add_library(evmc-example-vm SHARED example_vm.c)
target_link_libraries(evmc-example-vm PRIVATE evmc)
add_library(example-vm SHARED example_vm.c)
add_library(evmc::example-vm ALIAS example-vm)
target_link_libraries(example-vm PRIVATE evmc)
add_library(evmc-example-vm-static STATIC example_vm.c)
target_link_libraries(evmc-example-vm-static PRIVATE evmc)
add_library(example-vm-static STATIC example_vm.c)
add_library(evmc::example-vm-static ALIAS example-vm-static)
target_link_libraries(example-vm-static PRIVATE evmc)
set_source_files_properties(example_vm.cpp PROPERTIES
COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
if(EVMC_INSTALL)
install(TARGETS evmc-example-vm
install(TARGETS example-vm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

View File

@ -17,7 +17,7 @@ add_executable(
test_loader.cpp
)
target_link_libraries(evmc-unittests PRIVATE loader-mocked evmc-example-vm-static evmc-example-host instructions GTest::gtest_main)
target_link_libraries(evmc-unittests PRIVATE loader-mocked evmc::example-vm-static evmc-example-host instructions GTest::gtest_main)
set_target_properties(evmc-unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)
gtest_add_tests(TARGET evmc-unittests TEST_PREFIX ${PROJECT_NAME}/unittests/)

View File

@ -18,8 +18,8 @@ endif()
set(prefix ${PROJECT_NAME}/vmtester)
evmc_add_vm_test(NAME ${prefix}/examplevm TARGET evmc-example-vm)
evmc_add_vm_test(NAME ${prefix}/example_precompiles_vm TARGET evmc-example-precompiles-vm)
evmc_add_vm_test(NAME ${prefix}/examplevm TARGET example-vm)
evmc_add_vm_test(NAME ${prefix}/example_precompiles_vm TARGET example-precompiles-vm)
add_test(NAME ${prefix}/help COMMAND evmc-vmtester --version --help)
set_tests_properties(${prefix}/help PROPERTIES PASS_REGULAR_EXPRESSION "Usage:")