New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CryptAcquireContext should be found #10353
CryptAcquireContext should be found #10353
Conversation
Can any dev familiar with cmake explain how CMAKE_REQUIRED_INCLUDES is supposed to work? I notice in CMakeLists.txt it is sometimes appended to as a list and other times cleared, as it is before getting the type of curl_off_t, which seems to have caused this bug. The reporter's fix to move the CryptAcquireContext check before the curl_off_t check looks like it masks a larger problem. |
It's a list of include directories to use for all the checks that involve running a compiler. In my own projects I tend to re-set it after each check to make sure I'm not clobbering the next one, and to make sure the stuff I'm looking for is where I expect it, and not in some random place. |
https://cmake.org/cmake/help/latest/module/CheckSymbolExists.html check_symbol_exists(CryptAcquireContext "${CURL_INCLUDES}" USE_WINCRYPT) "${CURL_INCLUDES}" is windows.h;ws2tcpip.h;winsock2.h;wincrypt.h;sys/stat.h;sys/types.h;sys/utime.h;fcntl.h;idn2.h;io.h;locale.h;setjmp.h;signal.h;stdbool.h;stdlib.h;string.h;time.h;stddef.h File CheckSymbolExists.c: int main(int argc, char** argv) Another way to modify it: change "${CURL_INCLUDES}" to "windows.h" check_symbol_exists(CryptAcquireContext "windows.h" USE_WINCRYPT) or |
|
include windows.h not Windows.h
I looked at your latest changes and I don't understand how this works for you now if CMAKE_REQUIRED_INCLUDES does not need to be reset. Don't you have the same problem, where the previously set CMAKE_REQUIRED_INCLUDES uses the wrong include directory? |
CMAKE_REQUIRED_INCLUDES is ${CURL_SOURCE_DIR}/include cmake try compile CheckSymbolExists.c
CheckSymbolExists.c include unnecessary header files and idn2.h not found in ${CURL_SOURCE_DIR}/include The latest changes only include windows.h and wincrypt.h |
So in that case is the reason the test fails that idn2.h isn't found? |
Yes Befor That's enough to check CryptAcquireContext include |
Check for CryptAcquireContext in windows.h and wincrypt.h. Closes curl#10353
Thanks |
After set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include")
"D:\vcpkg\installed\x64-windows\include" is correct
microsoft/vcpkg#27978 (comment)