Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endif()

# Set include directories
set(ISAL_CRYPTO_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include
)

# Initialize EXTERN_HEADERS list
Expand Down Expand Up @@ -162,12 +162,12 @@ endif()

include(cmake/fips.cmake)

# Add common headers
list(APPEND EXTERN_HEADERS include/test.h include/types.h include/endian_helper.h)
# Add common headers (only public API headers)
list(APPEND EXTERN_HEADERS include/isa-l_crypto/types.h)

# Windows .def file for symbol exports (only needed on Windows)
if(WIN32)
set(ISAL_CRYPTO_DEF_FILE ${CMAKE_SOURCE_DIR}/isa-l_crypto.def)
set(ISAL_CRYPTO_DEF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/isa-l_crypto.def)
endif()

# Create the main ISA-L Crypto library
Expand Down Expand Up @@ -221,33 +221,35 @@ if(USE_NASM)
if(source MATCHES "\\.asm$")
get_filename_component(source_dir ${source} DIRECTORY)
set_source_files_properties(${source} PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR};${CMAKE_SOURCE_DIR}/${source_dir}")
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}")
endif()
endforeach()
endif()

# Include directories
target_include_directories(isal_crypto
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_SOURCE_DIR}/aes
${CMAKE_SOURCE_DIR}/intel-ipsec-mb/lib
${CMAKE_SOURCE_DIR}/md5_mb
${CMAKE_SOURCE_DIR}/sha1_mb
${CMAKE_SOURCE_DIR}/sha256_mb
${CMAKE_SOURCE_DIR}/sha512_mb
${CMAKE_SOURCE_DIR}/sm3_mb
${CMAKE_SOURCE_DIR}/mh_sha1
${CMAKE_SOURCE_DIR}/mh_sha256
${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128
${CMAKE_SOURCE_DIR}/rolling_hash
${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto
${CMAKE_CURRENT_SOURCE_DIR}/include/internal
${CMAKE_CURRENT_SOURCE_DIR}/aes
${CMAKE_CURRENT_SOURCE_DIR}/intel-ipsec-mb/lib
${CMAKE_CURRENT_SOURCE_DIR}/md5_mb
${CMAKE_CURRENT_SOURCE_DIR}/sha1_mb
${CMAKE_CURRENT_SOURCE_DIR}/sha256_mb
${CMAKE_CURRENT_SOURCE_DIR}/sha512_mb
${CMAKE_CURRENT_SOURCE_DIR}/sm3_mb
${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1
${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256
${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128
${CMAKE_CURRENT_SOURCE_DIR}/rolling_hash
)

# Generate isa-l_crypto.h header
set(ISAL_CRYPTO_HEADER "${CMAKE_BINARY_DIR}/isa-l_crypto.h")
configure_file(${CMAKE_SOURCE_DIR}/cmake/isa-l_crypto.h.in ${ISAL_CRYPTO_HEADER} @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/isa-l_crypto.h.in ${ISAL_CRYPTO_HEADER} @ONLY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the following lines fix the path problem

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,6 +249,14 @@ target_include_directories(isal_crypto

 # Generate isa-l_crypto.h header
 set(ISAL_CRYPTO_HEADER "${CMAKE_BINARY_DIR}/isa-l_crypto.h")
+list(REMOVE_DUPLICATES EXTERN_HEADERS)
+list(SORT EXTERN_HEADERS)
+set(ISAL_CRYPTO_INCLUDES "")
+foreach(HEADER ${EXTERN_HEADERS})
+    string(REPLACE "include/" "" HEADER_PATH ${HEADER})
+    string(APPEND ISAL_CRYPTO_INCLUDES "#include <${HEADER_PATH}>\n")
+endforeach()
+
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/isa-l_crypto.h.in ${ISAL_CRYPTO_HEADER} @ONLY)


# Install targets
include(GNUInstallDirs)
Expand All @@ -266,9 +268,9 @@ install(FILES ${ISAL_CRYPTO_HEADER}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

# Install headers
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/isa-l_crypto
# Install headers (only public headers, not internal/)
install(DIRECTORY include/isa-l_crypto
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)

Expand All @@ -283,7 +285,7 @@ install(EXPORT ISALCryptoTargets
include(CMakePackageConfigHelpers)

configure_package_config_file(
"${CMAKE_SOURCE_DIR}/cmake/ISALCryptoConfig.cmake.in"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ISALCryptoConfig.cmake.in"
"${CMAKE_BINARY_DIR}/ISALCryptoConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ISALCrypto
)
Expand All @@ -308,7 +310,7 @@ set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
set(VERSION ${PROJECT_VERSION})

configure_file(
"${CMAKE_SOURCE_DIR}/libisal_crypto.pc.in"
"${CMAKE_CURRENT_SOURCE_DIR}/libisal_crypto.pc.in"
"${CMAKE_BINARY_DIR}/libisal_crypto.pc"
@ONLY
)
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ CLEANFILES =
LDADD =
AM_MAKEFLAGS = --no-print-directory
noinst_HEADERS =
pkginclude_HEADERS = include/test.h include/types.h include/endian_helper.h
pkginclude_HEADERS = include/isa-l_crypto/types.h
noinst_LTLIBRARIES =
INCLUDE = -I $(srcdir)/include/
INCLUDE = -I $(srcdir)/include -I $(srcdir)/include/isa-l_crypto -I $(srcdir)/include/internal

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libisal_crypto.pc
Expand Down
2 changes: 1 addition & 1 deletion Makefile.nmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ objs = \
bin\version.obj


INCLUDES = -I./ -Isha1_mb/ -Isha256_mb/ -Isha512_mb/ -Imd5_mb/ -Imh_sha1/ -Imh_sha1_murmur3_x64_128/ -Imh_sha256/ -Irolling_hash/ -Ism3_mb/ -Iaes/ -Iinclude/ -Iintel-ipsec-mb/lib
INCLUDES = -I./ -Isha1_mb/ -Isha256_mb/ -Isha512_mb/ -Imd5_mb/ -Imh_sha1/ -Imh_sha1_murmur3_x64_128/ -Imh_sha256/ -Irolling_hash/ -Ism3_mb/ -Iaes/ -Iinclude/ -Iinclude/isa-l_crypto/ -Iinclude/internal/ -Iintel-ipsec-mb/lib
# Modern asm feature level, consider upgrading nasm before decreasing feature_level
CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy /ZH:SHA_256 /guard:cf
CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd
Expand Down
4 changes: 2 additions & 2 deletions aes/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
src_include += -I $(srcdir)/aes
src_include += -I $(srcdir)/intel-ipsec-mb/lib

extern_hdrs += include/aes_gcm.h include/aes_cbc.h include/aes_xts.h include/aes_keyexp.h include/isal_crypto_api.h
extern_hdrs += include/isa-l_crypto/aes_keyexp.h include/isa-l_crypto/isal_crypto_api.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to remove these extra header files?


lsrc += aes/gcm_pre.c
lsrc += aes/cbc_pre.c
Expand Down Expand Up @@ -112,7 +112,7 @@ lsrc_aarch64 += aes/aarch64/gcm_multibinary_aarch64.S \
aes/aarch64/cbc_dec_aes.S

other_src += include/multibinary.asm
other_src += include/test.h include/types.h include/reg_sizes.asm
other_src += include/isa-l_crypto/types.h include/reg_sizes.asm
other_src += aes/gcm_defines.asm
other_src += aes/aes_common.asm
other_src += aes/clear_regs.asm
Expand Down
18 changes: 9 additions & 9 deletions cmake/aes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ endif()

# Headers exported by aes module
set(AES_HEADERS
include/aes_gcm.h
include/aes_cbc.h
include/aes_xts.h
include/aes_keyexp.h
include/isal_crypto_api.h
include/isa-l_crypto/aes_gcm.h
include/isa-l_crypto/aes_cbc.h
include/isa-l_crypto/aes_xts.h
include/isa-l_crypto/aes_keyexp.h
include/isa-l_crypto/isal_crypto_api.h
)

# Add to main extern headers list
Expand Down Expand Up @@ -202,7 +202,7 @@ if(BUILD_TESTS OR BUILD_PERF)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()

Expand All @@ -214,15 +214,15 @@ if(BUILD_TESTS OR BUILD_PERF)
if(OPENSSL_FOUND)
target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto)
endif()
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes)
endforeach()

# Build examples
foreach(example_name ${AES_EXAMPLES})
get_filename_component(example_exec ${example_name} NAME)
add_executable(${example_exec} ${example_name}.c)
target_link_libraries(${example_exec} PRIVATE isal_crypto)
target_include_directories(${example_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes)
target_include_directories(${example_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes)
endforeach()
endif()

Expand All @@ -235,7 +235,7 @@ if(BUILD_TESTS OR BUILD_PERF)
if(OPENSSL_FOUND)
target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto)
endif()
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/aes)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/aes)
endforeach()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/fips.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if(BUILD_TESTS)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/fips)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/fips)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()
endif()
Expand Down
2 changes: 0 additions & 2 deletions cmake/isa-l_crypto.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
#include <isa-l_crypto/aes_xts.h>
#include <isa-l_crypto/aes_keyexp.h>
#include <isa-l_crypto/multi_buffer.h>
#include <isa-l_crypto/test.h>
#include <isa-l_crypto/types.h>
#include <isa-l_crypto/endian_helper.h>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these includes could be replaced by:

+@ISAL_CRYPTO_INCLUDES@

#endif //_ISAL_CRYPTO_H_
10 changes: 5 additions & 5 deletions cmake/md5_mb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ endif()

# Headers exported by md5_mb module
set(MD5_MB_HEADERS
include/md5_mb.h
include/multi_buffer.h
include/isa-l_crypto/md5_mb.h
include/isa-l_crypto/multi_buffer.h
)

# Add to main extern headers list
Expand Down Expand Up @@ -129,7 +129,7 @@ if(BUILD_TESTS OR BUILD_PERF)
add_executable(${test_exec} ${test_name}.c)
endif()
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()

Expand All @@ -141,7 +141,7 @@ if(BUILD_TESTS OR BUILD_PERF)
if(OPENSSL_FOUND)
target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto)
endif()
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb)
endforeach()
endif()

Expand All @@ -154,7 +154,7 @@ if(BUILD_TESTS OR BUILD_PERF)
if(OPENSSL_FOUND)
target_link_libraries(${test_exec} PRIVATE OpenSSL::Crypto)
endif()
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/md5_mb)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/md5_mb)
endforeach()
endif()
endif()
Expand Down
8 changes: 4 additions & 4 deletions cmake/mh_sha1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ endif()

# Headers exported by mh_sha1 module
set(MH_SHA1_HEADERS
include/mh_sha1.h
include/isa-l_crypto/mh_sha1.h
)

# Add to main extern headers list
Expand Down Expand Up @@ -110,7 +110,7 @@ if(BUILD_TESTS OR BUILD_PERF)
add_executable(${test_exec} ${test_name}.c)
endif()
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()

Expand All @@ -119,7 +119,7 @@ if(BUILD_TESTS OR BUILD_PERF)
# mh_sha1_update_test also needs mh_sha1_ref.c
add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()
endif()
Expand All @@ -129,7 +129,7 @@ if(BUILD_TESTS OR BUILD_PERF)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1)
endforeach()
endif()
endif()
Expand Down
8 changes: 4 additions & 4 deletions cmake/mh_sha1_murmur3_x64_128.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ endif()

# Headers exported by mh_sha1_murmur3_x64_128 module
set(MH_SHA1_MURMUR3_HEADERS
include/mh_sha1_murmur3_x64_128.h
include/isa-l_crypto/mh_sha1_murmur3_x64_128.h
)

# Add to main extern headers list
Expand All @@ -102,7 +102,7 @@ if(BUILD_TESTS OR BUILD_PERF)
# Tests need both mh_sha1_ref.c and murmur3_x64_128.c
add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()

Expand All @@ -111,7 +111,7 @@ if(BUILD_TESTS OR BUILD_PERF)
# Unit tests also need both helper files
add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()
endif()
Expand All @@ -121,7 +121,7 @@ if(BUILD_TESTS OR BUILD_PERF)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c mh_sha1/mh_sha1_ref.c mh_sha1_murmur3_x64_128/murmur3_x64_128.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha1 ${CMAKE_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1 ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha1_murmur3_x64_128)
endforeach()
endif()
endif()
Expand Down
8 changes: 4 additions & 4 deletions cmake/mh_sha256.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()

# Headers exported by mh_sha256 module
set(MH_SHA256_HEADERS
include/mh_sha256.h
include/isa-l_crypto/mh_sha256.h
)

# Add to main extern headers list
Expand Down Expand Up @@ -105,7 +105,7 @@ if(BUILD_TESTS OR BUILD_PERF)
add_executable(${test_exec} ${test_name}.c)
endif()
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()

Expand All @@ -114,7 +114,7 @@ if(BUILD_TESTS OR BUILD_PERF)
# mh_sha256_update_test also needs mh_sha256_ref.c
add_executable(${test_exec} ${test_name}.c mh_sha256/mh_sha256_ref.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()
endif()
Expand All @@ -124,7 +124,7 @@ if(BUILD_TESTS OR BUILD_PERF)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mh_sha256)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/mh_sha256)
endforeach()
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/misc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set(MISC_SOURCES

# Headers exported by misc module
set(MISC_HEADERS
include/isal_crypto_api.h
include/isa-l_crypto/isal_crypto_api.h
)

# Add to main extern headers list
Expand All @@ -49,7 +49,7 @@ if(BUILD_TESTS)
get_filename_component(test_exec ${test_name} NAME)
add_executable(${test_exec} ${test_name}.c)
target_link_libraries(${test_exec} PRIVATE isal_crypto)
target_include_directories(${test_exec} PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/misc)
target_include_directories(${test_exec} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/isa-l_crypto ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/misc)
add_test(NAME ${test_exec} COMMAND ${test_exec})
endforeach()
endif()
Expand Down
Loading