mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 08:56:17 +08:00
Update CMakeLists.txt and make demos optional
This commit is contained in:
@@ -362,11 +362,6 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
|
||||
target_link_libraries (${name}test LINK_PUBLIC gmssl)
|
||||
endforeach()
|
||||
|
||||
foreach(name ${demos})
|
||||
add_executable(${name} demos/src/${name}.c)
|
||||
target_link_libraries(${name} LINK_PUBLIC gmssl)
|
||||
endforeach()
|
||||
|
||||
install(TARGETS gmssl-bin RUNTIME DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@@ -383,6 +378,16 @@ if (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
# target_compile_options(gmssl-bin PRIVATE /wd4996)
|
||||
endif()
|
||||
|
||||
# cmake .. -DENABLE_DEMOS=ON
|
||||
option(ENABLE_DEMOS "Build demos" OFF)
|
||||
if (ENABLE_DEMOS)
|
||||
message(STATUS "ENABLE_DEMOS is ON")
|
||||
foreach(name ${demos})
|
||||
add_executable(${name} demos/src/${name}.c)
|
||||
target_link_libraries(${name} gmssl)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
set(CPACK_PACKAGE_NAME "GmSSL")
|
||||
set(CPACK_PACKAGE_VENDOR "GmSSL develop team")
|
||||
|
||||
Reference in New Issue
Block a user