Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Run clang-format
uses: jidicula/clang-format-action@c74383674bf5f7c69f60ce562019c1c94bc1421a # v4.13.0
uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0
with:
clang-format-version: '17'
clang-format-version: '21'
fallback-style: 'Google'

- uses: chartboost/ruff-action@e18ae971ccee1b2d7bbef113930f00c670b78da4 # v1.0.0
Expand Down
46 changes: 30 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
cmake_minimum_required(VERSION 3.28)
project(ncrypto)
project(ncrypto VERSION 1.0.1)

include(CTest)
include(GNUInstallDirs)
include(FetchContent)
include(cmake/ncrypto-flags.cmake)

if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

include(cmake/CPM.cmake)
if (NCRYPTO_SHARED_LIBS)
find_package(OpenSSL REQUIRED)
else()
include(FetchContent)
include(cmake/CPM.cmake)

CPMAddPackage(
CPMAddPackage(
NAME boringssl
VERSION 0.20250818.0
GITHUB_REPOSITORY google/boringssl
GIT_TAG 0.20250818.0
OPTIONS "BUILD_SHARED_LIBS OFF" "BUILD_TESTING OFF"
)
)
endif()

add_subdirectory(src)
add_library(ncrypto::ncrypto ALIAS ncrypto)

include_directories(${boringssl_SOURCE_DIR}/include)

if (NCRYPTO_TESTING)
CPMAddPackage(
if (NCRYPTO_SHARED_LIBS)
find_package(GTest REQUIRED)
else()
CPMAddPackage(
NAME GTest
GITHUB_REPOSITORY google/googletest
VERSION 1.15.2
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF"
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()
enable_testing()
add_subdirectory(tests)
endif()
Expand All @@ -53,3 +55,15 @@ install(
ARCHIVE COMPONENT ncrypto_development
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

# Generate pkg-config file
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ncrypto.pc.in
${CMAKE_CURRENT_BINARY_DIR}/ncrypto.pc
@ONLY
)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/ncrypto.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
1 change: 1 addition & 0 deletions cmake/ncrypto-flags.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
option(NCRYPTO_DEVELOPMENT_CHECKS "development checks (useful for debugging)" OFF)
option(NCRYPTO_TESTING "Build tests" ON)
option(NCRYPTO_SHARED_LIBS "Build (and test) using shared library" OFF)
option(NCRYPTO_BSSL_LIBDECREPIT_MISSING "enable if boringssl is built without libdecrepit" OFF)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
67 changes: 0 additions & 67 deletions include/dh-primes.h

This file was deleted.

Loading
Loading