-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
$<COMPILE_LANG_AND_ID:lang,id> may only be used with binary targets #1414
Comments
Ran into the same issue, downgrade to |
That is good to know. But actually I can even see the commit id of cmake that introduced this change (https://gitlab.kitware.com/ChrisTX/cmake/commit/e214abdaab4f8097095a601067b4071194ad01a5), and it seems this is the new default. The project needs to be updated sooner or later, or it will continue to fail with newer cmake. |
@smazurov do you happen to know in which CMakeLists.txt it fails? I could not find the string |
@emmenlau no, my error was very similar except it was line 443, my guess is its one of the global dependencies that get installed on the system. |
Line numbers vary a bit depending on distro patching, on FreeBSD with CMake 3.18 and folly 2020.07.27.00 we get this error message:
The file
where the Cflags line expands to
(On FreeBSD at least) Notice that there's now generator expressions in there, which is what trips up CMake later when it passes the file through FILE(GENERATE). That might be what's tripping up CMake 3.18 (I'll know more once my current build finishes) |
The CMake generator-expressions manpage suggests using
|
.. even without the missing |
After re-reading the code, I see that you are right about the issue. cmake trips over the generation of Also, this basically means that folly is currently not compatible with cmake 3.18+ |
Also, it seems #1232 should have solved this problem? |
@emmenlau Yes, it's cmake tripping over the generation. The older issue #1232 builds a "two stage" generation for expansion, but it's new that this specific generator expression leaks into the build. I've filed an upstream CMake bug, https://gitlab.kitware.com/cmake/cmake/-/issues/21074 , as well. The same problem affects https://github.com/arvidn/libtorrent/ |
Is what I added to packaging, it basically resets CFLAGS that are going to the pkgconfig file to use the INTERFACE_OPTIONS that would have come from CMake 3.17, before the changes in 3.18. See the CMake issue for details. |
CMake contributor here who introduced a feature resulting in a fix by another person, which caused this issue. CMake hasn't and will not guarantee stability and presence or lack there of of generator expressions on imported targets from builtin find modules. CMake doesn't consider this a regression. The workaround by @adriaandegroot is sensible. However, this seems like a valid usecase with no general solution possible in CMake. |
See arvidn/libtorrent#5069 for an example of a workaround+fix. |
Thanks @tambry that sounds good! Can/does folly already support this new |
…facebook#1433) Summary: CMake's find modules may have target-based generator expressions, which get propagated to us when generating the pkg-config file. CMake 3.19 introduces the TARGET argument to file(GENERATE), which allows resolving such generator expressions and will avoid future issues. A workaround proposed by adriaandegroot is added for CMake 3.18. Additionally changed list->string conversion to use list(JOIN) instead of string replacement. Fixes facebook#1414. Pull Request resolved: facebook#1433 Reviewed By: yfeldblum Differential Revision: D23433365 Pulled By: Orvid fbshipit-source-id: 6ef5f180e13b41f0c92137f53fd8c19ba6355dd6
1. We need to advance the version of Folly - not because of AArch64 but because the following issue is seen when using latest CMake: -- Configuring done CMake Error at CMakeLists.txt:445 (file): Error evaluating generator expression: $<COMPILE_LANG_AND_ID:CUDA,NVIDIA> $<COMPILE_LANG_AND_ID:lang,id> may only be used with binary targets to specify include directories, compile definitions, and compile options. It may not be used with the add_custom_command, add_custom_target, or file(GENERATE) commands. See upstream bug facebook/folly#1414 This also highlighed an issue with our Ubuntu20.04 Docker image (given I'm rebuilding all platforms) - the clang install is broken there due to an incorrect default runtime linker path. Details at CBD-4186, but given we don't need TSan packages for Folly on Ubuntu20.04 yet, just limit that to Ubuntu18.04 for now. Also update the versions of all Folly dependancies to versions with AArch64 support. Change-Id: I548854e34db32937ffe5d83627310355246bdab0 Reviewed-on: http://review.couchbase.org/c/tlm/+/156976 Tested-by: Dave Rigby <[email protected]> Tested-by: Build Bot <[email protected]> Reviewed-by: Chris Hillery <[email protected]>
I'm building folly
v2020.07.13.00
on Ubuntu 18.04 x86_64 with the standard system gcc but a newer cmake 3.18.0. On configure, I get the cmake error:cmake ends in error after that. I googled for this problem but could not find anything really useful. Also I can not find the lines
$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>
in folly so I'm slightly confused where the problem originates from. Can someone point me in the right direction please?The text was updated successfully, but these errors were encountered: