-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
CMake: Fix configuration on Win32 #2323
Conversation
The configuration step on Win32 through CMake still have room for improvement. For example, the meaning of
but I have a more aggressive patch here: myd7349@24965ee |
CMakeLists.txt
Outdated
@@ -35,7 +35,12 @@ endif() | |||
|
|||
# LIBM { | |||
include(CheckLibraryExists) | |||
check_library_exists(m pow "" WITH_HDRHISTOGRAM) | |||
check_library_exists(m pow "" HAVE_LIBM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On MSVC we don't need to, and probably shouldnt, check for libm at all.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edenhill Thanks for your review! I will update this PR later.
I think I like the more aggressive approach, better to get this all right in one go. |
8f15751
to
3f84c98
Compare
Here is a related discussion about |
- Remove WITHOUT_WIN32_CONFIG option - Fix hdr histogram check - Fix WITH_PLUGINS check - Specify _CRT_SECURE_NO_WARNINGS - Fix MSVC ARM64 check - Fix __ARM_ARCH_6KZ__ typo
3f84c98
to
e46df0c
Compare
the problem is that,
|
@myd7349 WITH_SNAPPY should always be set to 1 in CMakeLists.txt |
On Windows with MSVC, this line:
check_library_exists(m pow "" WITH_HDRHISTOGRAM)
causes
WITH_HDRHISTOGRAM
set toOFF
.As a result:
WITHOUT_WIN32_CONFIG=ON
, the histogram source will not be built.WITHOUT_WIN32_CONFIG=OFF
, there will be link erros sinceWITH_HISTOGRAM
is defined as 1 inwin32_config.h
References:
https://stackoverflow.com/questions/32816646/can-cmake-detect-if-i-need-to-link-to-libm-when-using-pow-in-c