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

Create native interop library System.Security.Cryptography.Native #745

Merged
merged 1 commit into from
Apr 21, 2015
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ if(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(src/ToolBox/SOS/lldbplugin)
add_subdirectory(src/pal)
add_subdirectory(src/coreclr/hosts/unixcorerun)
add_subdirectory(src/corefx)
endif(CLR_CMAKE_PLATFORM_UNIX)

# Add this subdir. We install the headers for the jit.
Expand Down
16 changes: 16 additions & 0 deletions src/corefx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# This portion of the tree is for portions of CoreFX libraries which are best
# suited to having been implemented in native code.
#
# This code should, ideally, be located in the corefx repository so it can be part of a
# single commit/pull-request with the managed code which consumes it, but corefx does not
# currently have support for building native libraries.
#
# The libraries should disable the "lib" prefix, and use an assembly-style naming format,
# such as System.Security.Cryptography.Native (shared across multiple System.Security.Cryptography.*
# assemblies) or System.Diagnostics.Process.Native (a native interop library for
# System.Diagnostics.Process.dll).

if(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(System.Security.Cryptography.Native)
endif(CLR_CMAKE_PLATFORM_UNIX)
1 change: 1 addition & 0 deletions src/corefx/System.Security.Cryptography.Native/.gitmirror
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
33 changes: 33 additions & 0 deletions src/corefx/System.Security.Cryptography.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

project(System.Security.Cryptography.Native)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

add_definitions(-DPIC=1)
add_definitions(-DBIT64=1)

find_library(CRYPTO NAMES crypto)
if(CRYPTO STREQUAL CRYPTO-NOTFOUND)
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)")
return()
endif()

add_compile_options(-fPIC)

set(NATIVECRYPTO_SOURCES
openssl.c
)

add_library(System.Security.Cryptography.Native
SHARED
${NATIVECRYPTO_SOURCES}
)

# Disable the "lib" prefix.
set_target_properties(System.Security.Cryptography.Native PROPERTIES PREFIX "")

target_link_libraries(System.Security.Cryptography.Native
${CRYPTO}
)

install (TARGETS System.Security.Cryptography.Native DESTINATION .)
Loading