Skip to content

Commit 43fd09c

Browse files
malytomaszpostfacto
authored andcommitted
use link_libraries in try_compile instead of pragma lib in cpp
1 parent 57bc9ea commit 43fd09c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if (WIN32)
8888
#
8989
# Check whether BCrypt can be used with this SDK version
9090
#
91-
try_compile(BCRYPT_AVAILABLE "${CMAKE_CURRENT_BINARY_DIR}/tryCompile" SOURCES "${CMAKE_CURRENT_LIST_DIR}/cmake/tryCompileTestBCrypt.cpp" OUTPUT_VARIABLE BCRYPT_AVAILABILITY_TEST_MESSAGES)
91+
try_compile(BCRYPT_AVAILABLE "${CMAKE_CURRENT_BINARY_DIR}/tryCompile" SOURCES "${CMAKE_CURRENT_LIST_DIR}/cmake/tryCompileTestBCrypt.cpp" LINK_LIBRARIES bcrypt OUTPUT_VARIABLE BCRYPT_AVAILABILITY_TEST_MESSAGES)
9292
if (NOT BCRYPT_AVAILABLE)
9393
message(STATUS ${BCRYPT_AVAILABILITY_TEST_MESSAGES})
9494
message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL")

cmake/tryCompileTestBCrypt.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <Windows.h>
22
#include <bcrypt.h>
33
#include <cstdio>
4-
#pragma comment(lib, "bcrypt.lib")
54

65
int main(int, char **)
76
{

0 commit comments

Comments
 (0)