fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
59fab4e7
rust-analyzer
1load ( "@rules_foreign_cc//foreign_cc:defs.bzl" , "cmake" ) 2 3filegroup ( 4name = "all_srcs" , 5srcs = glob ([ "**" ]), 6) 7 8_CACHE_ENTRIES = { 9"BUILD_EXAMPLES" : "off" , 10"BUILD_SHARED_LIBS" : "off" , 11"BUILD_TESTING" : "off" , 12"CMAKE_FIND_DEBUG_MODE" : "on" , 13"CMAKE_PREFIX_PATH" : "${CMAKE_PREFIX_PATH:-};$EXT_BUILD_DEPS/openssl" , 14} 15 16_LINUX_CACHE_ENTRIES = dict ( _CACHE_ENTRIES . items () + { 17"CMAKE_C_FLAGS" : "${CMAKE_C_FLAGS:-} -fPIC" , 18}. items ()) 19 20cmake ( 21name = "libssh2" , 22cache_entries = select ({ 23"@platforms//os:linux" : _LINUX_CACHE_ENTRIES , 24"//conditions:default" : _CACHE_ENTRIES , 25}), 26lib_source = ":all_srcs" , 27out_static_libs = select ({ 28# TODO: I'm guessing at this name. Needs to be checked on windows. 29"@platforms//os:windows" : [ "libssh2.lib" ], 30"//conditions:default" : [ "libssh2.a" ], 31}), 32visibility = [ "//visibility:public" ], 33deps = [ "@openssl" ], 34)