We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So I have the following in my CMakeLists.txt file:
include(FetchContent) set(FMT_TEST FF CACHE INTERNAL "disabling fmt tests") FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 8.0.1 GIT_PROGRESS TRUE USES_TERMINAL_DOWNLOAD TRUE ) FetchContent_MakeAvailable(fmt) ... target_link_libraries(mybinary PRIVATE fmt::fmt )
When cross-compiling with say an arm compiler, i get undefined reference errors like this:
<artificial>:(.text.startup+0x1588): undefined reference to `fmt::v8::vprint(fmt::v8::basic_string_view<char>, ...
I'm cross-compiling like this:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=arm-openwrt-linux-gcc -DCMAKE_CXX_COMPILER=arm-openwrt-linux-g++ ..
So i'm not specifying a toolchain file.
Now, is this a cmake bug in the FetchContent module, or is this a libfmt bug?
Cheers
The text was updated successfully, but these errors were encountered:
This works fine when not cross compiling. Note that a short term solution is to use fmt::fmt-header-only
fmt::fmt-header-only
Sorry, something went wrong.
Turns out the issue is because i'm compiling with -flto. Looking closely at the logs, i can see the following:
-flto
arm-openwrt-linux-ar: CMakeFiles/fmt.dir/src/format.cc.o: plugin needed to handle lto object
I thinks that's it.
Making target_compile_options PRIVATE, fix fmtlib#2726, fix fmtlib#2507
793a53a
Making target_compile_options PRIVATE, fix #2726, fix #2507
dfcc730
Successfully merging a pull request may close this issue.
So I have the following in my CMakeLists.txt file:
When cross-compiling with say an arm compiler, i get undefined reference errors like this:
I'm cross-compiling like this:
So i'm not specifying a toolchain file.
Now, is this a cmake bug in the FetchContent module, or is this a libfmt bug?
Cheers
The text was updated successfully, but these errors were encountered: