Skip to content
Merged
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
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# ~~~
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ build_script:
cd..
git clone https://github.com/libtom/libtommath.git --branch=master
cd libtommath
mkdir build
cd build
cmake -G "Ninja" ..
ninja
cd..
nmake -f makefile.msvc
cd..
cd libtomcrypt
mkdir build
cd build
cmake -G "Ninja" ..
ninja
cd..
nmake -f makefile.msvc all
test_script:
- cmd: test.exe