hg: make configparser buildable with cmake

Reviewed By: simpkins

Differential Revision: D17505870

fbshipit-source-id: 974ed48424b46a0828133b9fb05da86129c3e21f
This commit is contained in:
Zeyi (Rice) Fan 2019-09-30 10:39:17 -07:00 committed by Facebook Github Bot
parent 60b58132d1
commit 784f741312
3 changed files with 35 additions and 0 deletions

View File

@ -1 +1,2 @@
add_subdirectory(configparser)
add_subdirectory(revisionstore)

View File

@ -0,0 +1,31 @@
rust_static_library(rust_configparser CRATE configparser)
install_rust_static_library(
rust_configparser
EXPORT mercurial
INSTALL_DIR lib
)
add_library(configparser ConfigParser.cpp)
set_target_properties(
configparser
PROPERTIES
PUBLIC_HEADER
ConfigParser.h
)
target_include_directories(configparser PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(
configparser
PRIVATE
rust_configparser
Folly::folly
)
install(
TARGETS configparser
EXPORT mercurial
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
PUBLIC_HEADER DESTINATION "include/scm/hg/lib/configparser/"
)

View File

@ -22,3 +22,6 @@ tempdir = "0.3.7"
[[bench]]
name = "bench"
harness = false
[lib]
crate-type = ["staticlib", "lib"]