janbar / openssl-cmake

Build OpenSSL with CMake on MacOS, Win32, Win64 and cross compile for Android, IOS
Other
267 stars 138 forks source link

Build error if adding OPENSSL_NO_ENGINE macro #22

Open garden4hu opened 3 years ago

garden4hu commented 3 years ago

Hello I got some errors when I try to add this macro OPENSSL_NO_ENGINE to CMakelist.txt. I try to add it to CMakelist.txt like this:

set( CONF "
#define OPENSSL_NO_MD2
#define OPENSSL_NO_RC5
#define OPENSSL_NO_RFC3779
#define OPENSSL_NO_EC_NISTP_64_GCC_128
#define OPENSSL_NO_ASYNC
#define OPENSSL_NO_ENGINE
${CONF}" )

I got some errors when I try to build the libs. It looks like blow:

/path/openssl-cmake-linux/crypto/engine/eng_all.c:11:
/path/openssl-cmake-linux/crypto/engine/eng_local.h:134:5: error: unknown type name 'ENGINE_CIPHERS_PTR'
    ENGINE_CIPHERS_PTR ciphers;

In fact ENGINE_CIPHERS_PTR is shielded by macro OPENSSL_NO_ENGINE in include/openssl/engine.h. According to my experience, if this macro is defined, the engine-related source files will not participate in the compilation. The same issue also occurs when using another macro OPENSSL_NO_COMP.

So I want to confirm whether it currently supports the use of macros to customize some functions?

Thanks very much.

janbar commented 2 years ago

Hi, unfortunately the conf is static. The reason is the official build generates some sources and headers with perl instead use of preprocessing.