mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 21:53:41 +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)
|
target_link_libraries (${name}test LINK_PUBLIC gmssl)
|
||||||
endforeach()
|
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)
|
install(TARGETS gmssl-bin RUNTIME DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -383,6 +378,16 @@ if (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|||||||
# target_compile_options(gmssl-bin PRIVATE /wd4996)
|
# target_compile_options(gmssl-bin PRIVATE /wd4996)
|
||||||
endif()
|
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_NAME "GmSSL")
|
||||||
set(CPACK_PACKAGE_VENDOR "GmSSL develop team")
|
set(CPACK_PACKAGE_VENDOR "GmSSL develop team")
|
||||||
|
|||||||
Reference in New Issue
Block a user