Properly handle when header file is not found

When header file is not found, generate a dummy Makefile and target
result so extension build will be successful but essentially a no-op
This commit is contained in:
Chris Roberts 2023-05-25 16:36:44 -07:00
parent 415b006ebd
commit e3c8ad33ff

View File

@ -8,4 +8,11 @@ if have_header("openssl/opensslv.h")
end
append_ldflags(["-lssl"])
create_makefile("vagrant_ssl")
else
# If the header file isn't found, just create a dummy
# Makefile and stub the library to make it a noop
File.open("Makefile", "wb") do |f|
f.write(dummy_makefile(__dir__).join("\n"))
end
FileUtils.touch("vagrant_ssl.so")
end