Replies: 1 comment 4 replies
-
Usually, it is enough to call |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've been using spdlog for quite some time now. I added it as a submodule to my project over 2 years ago, when in the README it still said to copy
src/spdlog.cpp
to project's source directory for faster compile times.Recently I decided to update the submodule and after that had lots of linker errors. To make the long story short it turned out that templates are not initialized, because more files appeared next to
src/spdlog.cpp
. Then I noticed that the info on addingsrc/spdlog.cpp
to my source directory is gone from the README and only the precompiled info remains.Here is my problem - my project is cross-compiled for ARM with unit tests for x86_64 and both binaries use spdlog (since some tested modules require spdlog). The problem is that I would have to use 2 separately built spdlog libraries, but I use spdlog as a submodule in my project already so I'd rather have the old option with adding spdlog files to the rest of my compiled files.
I didn't want to add all files from
spdlog/src
by hand since with later updates when more files are added I'd have to make changes, so I did the following:CMakeLists.txt
file I added the following line:AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/spdlog/src SPDLOG_COMPILE_FILES)
CMakeLists.txt
file which has anADD_EXECUTABLE
I added to the end of the file list${SPDLOG_COMPILE_FILES}
What
AUX_SOURCE_DIRECTORY
does is it saves the file names located inspdlog/src
directory toSPDLOG_COMPILE_FILES
variable.My question is - is this ok? It seems to be update-proof since if new files are added the list of files updates automatically, but I have an impression that I'm doing something completely wrong and nobody is doing it this way since I can't find any information about it...
Thank you in advance for any insight on this problem.
Beta Was this translation helpful? Give feedback.
All reactions