nixpkgs/pkgs/development/compilers/solc/patches/shared-libs-install.patch
2019-06-26 00:28:51 +08:00

72 lines
2.8 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c05208f..8893648e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,22 @@ add_subdirectory(libevmasm)
add_subdirectory(libsolidity)
add_subdirectory(libsolc)
+install(DIRECTORY libdevcore/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libdevcore
+ FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY libevmasm/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libevmasm
+ FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY libsolidity/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libsolidity
+ FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY libyul/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libyul
+ FILES_MATCHING PATTERN "*.h")
+install(DIRECTORY liblangutil/
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblangutil
+ FILES_MATCHING PATTERN "*.h")
+
if (NOT EMSCRIPTEN)
add_subdirectory(solc)
add_subdirectory(liblll)
diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt
index fa7e3f48..1f9f52b4 100644
--- a/libdevcore/CMakeLists.txt
+++ b/libdevcore/CMakeLists.txt
@@ -6,3 +6,4 @@ target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Bo
target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}")
target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
add_dependencies(devcore solidity_BuildInfo.h)
+install(TARGETS devcore LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt
index 86192c1b..e7f15e93 100644
--- a/libevmasm/CMakeLists.txt
+++ b/libevmasm/CMakeLists.txt
@@ -3,3 +3,4 @@ file(GLOB headers "*.h")
add_library(evmasm ${sources} ${headers})
target_link_libraries(evmasm PUBLIC devcore)
+install(TARGETS evmasm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt
index 0bdec4b4..e876177e 100644
--- a/libsolidity/CMakeLists.txt
+++ b/libsolidity/CMakeLists.txt
@@ -29,6 +29,7 @@ endif()
add_library(solidity ${sources} ${z3_SRCS} ${cvc4_SRCS})
target_link_libraries(solidity PUBLIC yul evmasm langutil devcore Boost::boost Boost::filesystem Boost::system)
+install(TARGETS solidity LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if (${Z3_FOUND})
target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})
--- a/libyul/CMakeLists.txt
+++ b/libyul/CMakeLists.txt
@@ -43,3 +43,4 @@ endif()
optimiser/VarDeclPropagator.cpp
)
target_link_libraries(yul PUBLIC evmasm devcore langutil)
+install(TARGETS yul LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
--- a/liblangutil/CMakeLists.txt
+++ b/liblangutil/CMakeLists.txt
@@ -11,3 +11,4 @@ endif()
add_library(langutil ${sources})
target_link_libraries(langutil PUBLIC devcore)
+install(TARGETS langutil LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})