Page MenuHomePhabricator

[cmake] add openssl includes for tests to compile properly
ClosedPublic

Authored by schancel on May 1 2018, 22:35.

Details

Summary

As per title, this is required to build tests when openssl is in a custom location.

Fixes the following error:

[257/259] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/crypto_tests.cpp.o
FAILED: src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/crypto_tests.cpp.o
ccache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DBOOST_TEST_DYN_LINK -DHAVE_CONFIG_H -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_MACOSX -Isrc/test -isystem /usr/local/include -I../src/univalue/include -I../src/. -Isrc -Isrc/crypto/.. -I../src/secp256k1/include -I../src/leveldb/include -Wall -Wextra -Wformat -Wvla -Wformat-security -Wcast-align -Wunused-parameter -Wno-unused-parameter -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fvisibility=hidden   -std=gnu++11 -MD -MT src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/crypto_tests.cpp.o -MF src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/crypto_tests.cpp.o.d -o src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/crypto_tests.cpp.o -c ../src/wallet/test/crypto_tests.cpp
../src/wallet/test/crypto_tests.cpp:12:10: fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>
         ^~~~~~~~~~~~~~~
1 error generated.
Test Plan
cmake && ninja check

Diff Detail

Event Timeline

deadalnix added inline comments.
src/test/CMakeLists.txt
138 ↗(On Diff #3690)

This seems to suggest that the crypto lib exposes sll through it's header? In that case, the crypto lib should ass openssl include dir as a public header include. Unless the tests are testing something internal that's not exposed throught the API or using sll themselves.

143 ↗(On Diff #3690)

util depends on crypto, so it is already linked in.

deadalnix requested changes to this revision.May 2 2018, 15:31
This revision now requires changes to proceed.May 2 2018, 15:31
src/test/CMakeLists.txt
138 ↗(On Diff #3690)

Test needs tests need <openssl/aes.h>

Remove linking to libcrypto, it's already in there

schancel retitled this revision from [cmake] add libcrypto for tests to compile properly to [cmake] add openssl includes for tests to compile properly.May 2 2018, 17:50
This revision is now accepted and ready to land.May 2 2018, 17:50
This revision was automatically updated to reflect the committed changes.