Having looked at this :
and
Multiple files for builds 2019
to which there was no answer, I was wondering if it was possible to link object files using the build system.
I can compile using this build system:
{
"cmd" : ["clang++-3.8 -std=c++14 -stdlib=libc++ -w -c ${file_name}"],
"selector" : "source.c",
"shell": true,
"file_regex":"^(|..[^:]*):([0-9]*):?([0-9]*)?:? (.*)$",
"working_dir" : "$file_path"
}
but linking is a bit trickier, take this for example:
g++ WLM001.o DeleterTemplates.o sdl_helper.o PS_HelperStructs.o PosterSurface.o GTexture.o -lSDL2 -lSDL2_image -lc++ -lm -lgcc_s -lgcc -lc -o WLM004
The command would be something like:
“cmd” : ["g++ ${file_name0}.o ${file_name1}.o ${file_name2}.o ${file_name3}.o -lSDL2 -lSDL2_image -lc++ -lm -lgcc_s -lc ${some_other_filename}"],
My questions are:
The file_names in bold are wrong, what would be the correct format ?
Is it possible to have a variadic format so that the command argument could take any number of object files as an input, either user defined, open files or all the object files in the directory?
Again some_other_filename in italics is also wrong. What would the correct syntax, to either use an extensionless version of the first file in bold or a user defined input ?
Is any of this possible ?
Am I barking up the wrong tree completely ?
All the best y’all !
Lozminda