mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
Fix CMake configure on Windows
This commit is contained in:
parent
3905c28913
commit
5b93429053
1 changed files with 11 additions and 11 deletions
|
|
@ -119,17 +119,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
|
|||
list(APPEND LTC_C_FLAGS -no-undefined)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
|
||||
check_symbol_exists(BCryptGenRandom "Windows.h;bcrypt.h" BCRYPT_AVAILABLE)
|
||||
cmake_pop_check_state()
|
||||
if(BCRYPT_AVAILABLE)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Bcrypt)
|
||||
list(APPEND LTC_C_FLAGS -DLTC_WIN32_BCRYPT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If the user set the environment variables at generate-time, append them in order to allow
|
||||
# overriding our defaults.
|
||||
# ~~~
|
||||
|
|
@ -160,6 +149,17 @@ set_target_properties(
|
|||
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
|
||||
check_symbol_exists(BCryptGenRandom "Windows.h;bcrypt.h" BCRYPT_AVAILABLE)
|
||||
cmake_pop_check_state()
|
||||
if(BCRYPT_AVAILABLE)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Bcrypt)
|
||||
list(APPEND LTC_C_FLAGS -DLTC_WIN32_BCRYPT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(COMPILE_LTO "Build with LTO enabled")
|
||||
if(COMPILE_LTO)
|
||||
check_ipo_supported(RESULT COMPILER_SUPPORTS_LTO)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue