From 784f741312e471c5388378fa2aa08fcc377c54be Mon Sep 17 00:00:00 2001 From: "Zeyi (Rice) Fan" Date: Mon, 30 Sep 2019 10:39:17 -0700 Subject: [PATCH] hg: make configparser buildable with cmake Reviewed By: simpkins Differential Revision: D17505870 fbshipit-source-id: 974ed48424b46a0828133b9fb05da86129c3e21f --- lib/CMakeLists.txt | 1 + lib/configparser/CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ lib/configparser/Cargo.toml | 3 +++ 3 files changed, 35 insertions(+) create mode 100644 lib/configparser/CMakeLists.txt diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f8109ce6ae..fcbb064f14 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1 +1,2 @@ +add_subdirectory(configparser) add_subdirectory(revisionstore) diff --git a/lib/configparser/CMakeLists.txt b/lib/configparser/CMakeLists.txt new file mode 100644 index 0000000000..7ef64a4d1e --- /dev/null +++ b/lib/configparser/CMakeLists.txt @@ -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 + $ + $ +) +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/" +) diff --git a/lib/configparser/Cargo.toml b/lib/configparser/Cargo.toml index 716b5891f9..1f210561c5 100644 --- a/lib/configparser/Cargo.toml +++ b/lib/configparser/Cargo.toml @@ -22,3 +22,6 @@ tempdir = "0.3.7" [[bench]] name = "bench" harness = false + +[lib] +crate-type = ["staticlib", "lib"]