#include <openssl/opensslv.h>
My WORKSPACE file in the repo looks like(it looks for openssl installed via homebrew):
new_http_archive(
name = "uwebsockets",
urls = ["https://github.com/uNetworking/uWebSockets/archive/master.zip"],
build_file = "BUILD.uWebSockets",
)
new_local_repository(
name = "systemssl",
path = "/usr/local/opt/openssl",
build_file = "BUILD.systemssl",
)
BUILD.uWebSockets:
cc_library(
name = "uwebsockets-lib",
hdrs = glob(["**/src/*.h"]),
srcs = glob(["**/src/*.cpp"]),
visibility = ["//visibility:public"],
deps = [
"@systemssl//:openssl",
],
)
BUILD.systemssl:
cc_library(
name = "openssl",
hdrs = glob(["**/openssl/*.h"]),
srcs = glob([
"**/libssl.a",
"**/libcrypto.a",
]),
visibility = ["//visibility:public"],
)
Whenever I try to run the build I get:
external/uwebsockets/uWebSockets-master/src/Networking.h:7:10: fatal error: 'openssl/opensslv.h' file not found
I must be missing something here, what am I doing wrong?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/4e6fc15f-74c9-4e03-b6ae-aadaba3720de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you for your help, I got it to work! In the end my BUILD.systemssl file ended up looking like this:
cc_library(
name = "openssl",
hdrs = glob(["**/include/openssl/*.h"]),
srcs = glob([
"**/libssl.a",
"**/libcrypto.a",
]),
strip_include_prefix= "include",
includes = ['./include/openssl'],
visibility = ["//visibility:public"],
)
I guess the include directory was a couple levels at "external/systemssl/include/openssl" so I had to add strip_include_prefix= "include" in order to allow uWebSockets to #include <openssl/opensslv.h>. Is this the right way to do this?