Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c00a2f6

Browse files
committed
Merge pull request #2457 from nguerrera/move-openssl-shim
Move native crypto from coreclr to corefx
2 parents 14e98f7 + d93b0ed commit c00a2f6

File tree

3 files changed

+810
-1
lines changed

3 files changed

+810
-1
lines changed

src/Native/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ else ()
2424
message(FATAL_ERROR "Unknown build type. Set CMAKE_BUILD_TYPE to DEBUG or RELEASE.")
2525
endif ()
2626

27-
add_subdirectory(System.IO.Native)
27+
add_subdirectory(System.IO.Native)
28+
add_subdirectory(System.Security.Cryptography.Native)
29+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
project(System.Security.Cryptography.Native)
3+
4+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
5+
6+
add_definitions(-DPIC=1)
7+
8+
find_library(CRYPTO NAMES crypto)
9+
if(CRYPTO STREQUAL CRYPTO-NOTFOUND)
10+
message(WARNING "Cannot find libcrypto, skipping build for System.Security.Cryptography.Native. .NET cryptography is not expected to function. Try installing libssl-dev (or the appropriate package for your platform)")
11+
return()
12+
endif()
13+
14+
set(NATIVECRYPTO_SOURCES
15+
openssl.c
16+
)
17+
18+
add_library(System.Security.Cryptography.Native
19+
SHARED
20+
${NATIVECRYPTO_SOURCES}
21+
)
22+
23+
# Disable the "lib" prefix.
24+
set_target_properties(System.Security.Cryptography.Native PROPERTIES PREFIX "")
25+
26+
target_link_libraries(System.Security.Cryptography.Native
27+
${CRYPTO}
28+
)
29+
30+
install (TARGETS System.Security.Cryptography.Native DESTINATION .)

0 commit comments

Comments
 (0)