

Thanks so much, I appreciate any help or questions as to how I could make this clearer. First, you use includedirectories () to tell CMake to add the directory as -I to the compilation command line. Which is why I added it in the first place.Īnyone more experienced in CMake able to help me understand what's going wrong? If I remove the -flto flag, the error I get is C:\Users\share\AppData\Local\Temp\cc2RBUHc.s: Fatal error: can't write 104 bytes to section. Interestingly, when I put the dependencies.cmake in the outmost directory (alongside cmakelists.txt ) both cases work. I've checked the code and don't see two definitions of anything? I even tried deleting my "build" folder and running cmake + build again, but the same error shows up. I'm just lost as to what this error means.

Set(CMAKE_CXX_FLAGS "$ -fno-lto") to no avail. Project(TestProject) #name of your project My CMake file looks like this: cmake_minimum_required(VERSION 3.14) # version can be different The code I'm trying to test is Arduino based, so I'm trying to use an Arduino Mocking library I found through PlatformIO
Cmake include text file how to#
I write my code in VSCode, and I'm just learning how to use CTests with CMake.
I apologize in advance, I'm learning all of this as I go, so I might be overly verbose since I don't know what is important to mention.Ī little bit of environment background, I'm on a Windows 11 machine with mingw64 installed. CMake is able to build successfully using the library headers, but CLion highlights the include in red: include