-
Notifications
You must be signed in to change notification settings - Fork 240
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
CMakeDetermineCompileFeatures throwing errors #851
Comments
Is it possible that you need a different CMake version? |
It seems that Line 14 in 5031f5b
Line 42 in 5031f5b
This problem should be avoided by making the following changes to +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0)
+ include(CMakeDetermineCompilerSupport)
+ cmake_determine_compiler_support(CXX)
+else()
+ include(CMakeDetermineCompileFeatures)
+ cmake_determine_compile_features(CXX)
+endif()
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(CheckSymbolExists)
-include(CMakeDetermineCompileFeatures)
include(CheckCXXSourceCompiles)
include(CMakeFindDependencyMacro)
(skip...)
-cmake_determine_compile_features(CXX)
cmake_policy(SET CMP0057 NEW) |
That solved it, thank you for your help and patience, I truly appreciate it! |
Reopening this. It's not enough to have a solution that users can find for themselves. It should work out of the box, so I'll integrate the fix. Thanks again @tt4g! |
I spotted this problem yesterday, and asked around on the cmake support/forum. The solution implemented here, will indeed solve the problem. But it seems by design this snippet is bad and should not be used. The answer I got from Craig Scott: kind regards, |
No word on what we should do instead? Because we probably need to do something. |
(Mentioning @killerbot242 because Github may not notify you on a closed ticket. In fact I'd be in favour of opening a new one.) |
Hi Jeroen (@jtv ), could you answer what you try to accomplish on the cmake discourse link above. I asked for the apis to use, but Craig turned the question around, and would like to know what you are trying to do. |
I have the impression, you are doing this in order to get the value of "CMAKE_CXX_COMPILE_FEATURES" ? but one can just do this, no include of something needed it seems ??? cmake_minimum_required(VERSION 3.30) |
I found As @killerbot242 pointed out, it looks like it was added for the following code that references fc2a530#diff-7520a891ea97b695753e3db2aaf7b2e26a6ab475ff0d62e4071355f74a06304dR43-R47 cmake_determine_compile_features(CXX)
cmake_policy(SET CMP0057 NEW)
if (cxx_attribute_deprecated IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(PQXX_HAVE_DEPRECATED)
endif () Since this code has already been removed, |
with respect to keeping the config.cmake clean, I think the following are also no longer needed: CheckIncludeFileCXX --> there are no more checks for certain include files (at least not here) I have not checked the purpose of CMakeFindDependencyMacro, by its name it sounds like another internal api not to be used ?? |
by the way, modern cmake discourages GLOB, and advices to explicitly enumerate the source files |
@killerbot242 Can you send a PR? |
what do you think of the idea, to include stuff only where needed ? Incorporate feature checks based on C++ feature test macinclude(pqxx_cxx_feature_checks) ==> so only in there, we actually need :
|
detect_code_compiled also seems no longer used and can be removed ? |
Obviously unused CMake functions, and |
I can create PRs , most probably per subtopic, but I can not make branches in here in github, and I am not familiar with the process on github, and this specific repo ? |
You can find many explanations of this procedure by searching for "GitHub Fork Pull Request". See also GitHub Document: |
Thanks @killerbot242, some PRs would be most appreciated! I'm in a place with 74% packet loss, high temperatures, and incredible noise — and CMake is a topic for which I rely mostly on contributors. (Also I like to see contributors credited in the git logs. I used to spell this out in change logs, but it's easy to get wrong and mixing it in with the technical details tends to become messy. Better if git just tells people that you contributed something.) |
Fixes microsoft#39694 Upstream issue: jtv/libpqxx#851
I tried to create my first commit/push to the fork, and it fails :-( during the push. git push Any suggestions ? |
The following comments explains why it was added, and that indeed it is no longer needed, as such. jtv#851 (comment) Note that neither of these 2 cmake modules are for public use, they are internal cmake stuff. Nothing on the outside should use it. This was feedback given by kitware developers.
I was able to create a token, and with that I could push. |
The following comments explains why it was added, and that indeed it is no longer needed, as such. jtv#851 (comment) Note that neither of these 2 cmake modules are for public use, they are internal cmake stuff. Nothing on the outside should use it. This was feedback given by kitware developers.
Can you create a pull request to merge pushed code into this repository? |
first PR is created, once this one is processed I will move on to the next one. I would like to bring them in little chunks, each focusing at one topic. |
The following comments explains why it was added, and that indeed it is no longer needed, as such. #851 (comment) Note that neither of these 2 cmake modules are for public use, they are internal cmake stuff. Nothing on the outside should use it. This was feedback given by kitware developers.
That you for that by the way @killerbot242 - I find it's much better to get through these things in small chunks. |
* remove a use added for a purpose which is gone in the meantime. The following comments explains why it was added, and that indeed it is no longer needed, as such. #851 (comment) Note that neither of these 2 cmake modules are for public use, they are internal cmake stuff. Nothing on the outside should use it. This was feedback given by kitware developers. * not on master should be on a branch Revert "remove a use added for a purpose which is gone in the meantime." This reverts commit 7fdd2f8. * based upon the CMAKE_CXX_STANDARD, cmake can generate an option like : -std=c++17, -std=c++20, ... Just before the try_compile sections are exectued, the following happens: - CMAKE_REQUIRED_DEFINITIONS is back-up-ed - next it gets adjusted, to contain the cmpiler option to specif the language standard, this is done by setting ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION} - some exampes of that are: CMAKE_CXX17_STANDARD_COMPILE_OPTION: -std=c++17 , CMAKE_CXX20_STANDARD_COMPILE_OPTION: -std=c++20 - and that value becomes the new value for CMAKE_REQUIRED_DEFINITIONS - next all the try_compile statements are issued - and afterwards the CMAKE_REQUIRED_DEFINITIONS is restored Now all of that is not needed, since the minimum cmake required is 3.8. And in cmake 3.8 an adjustment was made so the standard selection compile option is passed to try_compile invocations. See here : https://cmake.org/cmake/help/latest/policy/CMP0067.html#policy:CMP0067 : Honor language standard in try_compile() source-file signature. This means that any cmake version >= 3.8 is using by default this new behavior (unless someone would overrule it and put it explicitly to old). I have done experiments with this, toether with the changed cmake_minimum_required syntax (it can have range), whic allowed me to have newer cmake behave as 3.7 and 3.8 ... , and in 3.7 the lnaguag standard indeed was not passed on, but in 3.8 it is. Conclusion : this entire process mentioned above is not needed, this is the default behavior of cmake (since 3.8).
* remove a use added for a purpose which is gone in the meantime. The following comments explains why it was added, and that indeed it is no longer needed, as such. #851 (comment) Note that neither of these 2 cmake modules are for public use, they are internal cmake stuff. Nothing on the outside should use it. This was feedback given by kitware developers. * not on master should be on a branch Revert "remove a use added for a purpose which is gone in the meantime." This reverts commit 7fdd2f8. * no need for include for try_compile
Hello, obligatory very new to this and C++ programming in general. I'm trying to build the files using the provided guide and whenever I try and run the build, no matter what I change, I get this information:
I'm very lost on what to do and I've been at this for several hours now so I'm throwing in the towel and asking here. Any help is much appreciated.
The text was updated successfully, but these errors were encountered: