Skip to content

Commit

Permalink
[Thirdparty] Refine cmake files to fix compiling error after cleaning…
Browse files Browse the repository at this point in the history
… with clang++.
  • Loading branch information
q82419 committed Feb 18, 2020
1 parent 6621048 commit f87f6ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion test/evmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_executable(ssvmEVMCTests

target_link_libraries(ssvmEVMCTests
PRIVATE
utilEVMC
utilEVMCLoader
utilGoogleTest
ssvmVM
${CMAKE_DL_LIBS}
Expand Down
4 changes: 1 addition & 3 deletions thirdparty/evmc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
add_library(utilEVMC
lib/loader/loader.c
)
add_subdirectory(lib)
11 changes: 1 addition & 10 deletions thirdparty/evmc/lib/instructions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
# Licensed under the Apache License, Version 2.0.

add_library(
instructions STATIC
${include_dir}/evmc/instructions.h
utilEVMCInstructions STATIC
instruction_metrics.c
instruction_names.c
)

add_library(evmc::instructions ALIAS instructions)
set_target_properties(instructions PROPERTIES OUTPUT_NAME evmc-instructions)
target_include_directories(instructions PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)

if(EVMC_INSTALL)
install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
16 changes: 3 additions & 13 deletions thirdparty/evmc/lib/loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@
# Licensed under the Apache License, Version 2.0.

add_library(
loader STATIC
${include_dir}/evmc/loader.h
utilEVMCLoader STATIC
loader.c
)

add_library(evmc::loader ALIAS loader)
set_target_properties(loader PROPERTIES
OUTPUT_NAME evmc-loader
set_target_properties(utilEVMCLoader PROPERTIES
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(EVMC_INSTALL)
install(TARGETS loader EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
target_link_libraries(utilEVMCLoader INTERFACE ${CMAKE_DL_LIBS})

0 comments on commit f87f6ec

Please sign in to comment.