File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,18 @@ CPMAddPackage(
20
20
GIT_TAG 0.20250114.0
21
21
OPTIONS "BUILD_SHARED_LIBS OFF" "BUILD_TESTING OFF"
22
22
)
23
- message (STATUS "BoringSSL source dir: ${boringssl_SOURCE_DIR} " )
23
+ add_subdirectory (src )
24
+ add_library (ncrypto::ncrypto ALIAS ncrypto )
25
+
24
26
include_directories (${boringssl_SOURCE_DIR} /include )
25
27
28
+
29
+ target_link_libraries (ncrypto PUBLIC
30
+ ${boringssl_BINARY_DIR} /ssl/libssl.a
31
+ ${boringssl_BINARY_DIR} /crypto/libcrypto.a
32
+ )
33
+
34
+
26
35
if (NCRYPTO_TESTING )
27
36
CPMAddPackage (
28
37
NAME GTest
@@ -36,9 +45,6 @@ if (NCRYPTO_TESTING)
36
45
add_subdirectory (tests )
37
46
endif ()
38
47
39
- add_subdirectory (src )
40
- add_library (ncrypto::ncrypto ALIAS ncrypto )
41
-
42
48
install (
43
49
FILES include /ncrypto.h
44
50
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
Original file line number Diff line number Diff line change 1
1
option (NCRYPTO_DEVELOPMENT_CHECKS "development checks (useful for debugging)" OFF )
2
2
option (NCRYPTO_TESTING "Build tests" ON )
3
3
4
+ set (CMAKE_POSITION_INDEPENDENT_CODE ON )
4
5
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
5
6
set (CMAKE_CXX_STANDARD 20 )
6
7
set (CMAKE_CXX_STANDARD_REQUIRED ON )
Original file line number Diff line number Diff line change 1
1
add_library (ncrypto ncrypto.cpp engine.cpp )
2
- target_link_libraries (ncrypto boringssl )
3
-
2
+ add_dependencies (ncrypto crypto ssl )
4
3
target_include_directories (ncrypto
5
4
PUBLIC
6
5
$< BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include>
7
6
$< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>
8
7
$< BUILD_INTERFACE:${CMAKE_SOURCE_DIR} >
9
8
$< BUILD_INTERFACE:${boringssl_SOURCE_DIR} /include>
10
9
)
10
+
11
+ target_link_libraries (ncrypto PUBLIC
12
+ ${boringssl_BINARY_DIR} /ssl/libssl.a
13
+ ${boringssl_BINARY_DIR} /crypto/libcrypto.a
14
+ )
Original file line number Diff line number Diff line change 1
1
include (GoogleTest )
2
- include (CTest )
3
2
add_executable (basic basic.cpp )
4
- target_link_libraries (
5
- basic
6
- GTest::gtest_main
7
- )
8
- target_link_libraries (basic ncrypto )
9
- add_test (basic_test basic )
3
+ target_link_libraries (basic PRIVATE ncrypto GTest::gtest_main )
10
4
gtest_discover_tests (basic )
5
+ if (MSVC OR MINGW )
6
+ target_compile_definitions (basic PRIVATE _CRT_SECURE_NO_WARNINGS )
7
+ endif ()
You can’t perform that action at this time.
0 commit comments