Skip to content

Make the object file extension configurable

swaldhoer requested to merge swaldhoer/waf:make-o-configurable into master
  • Make the extension of the generated object files from C-compilers configurable.
  • Defaults to o

This enhances the compiler setup on some compilers (MSVC, Embarcadero, and some embedded compilers) with respect to the platform specific default behavior.

Tested:

def options(opt):
    opt.load("compiler_c")

def configure(conf):
    conf.env.O_EXT = "obj"
    conf.load("compiler_c")
    conf.check(fragment="int main() { return 0; }\n")

(reduced the log text for readability by using ...)

11:22:53 runner ['...\\CL.exe',  ... , '/Fo...\\test.cpp.1.obj']
11:22:54 runner ['...\\LINK.exe', ... 'test.cpp.1.obj', ...]

Not setting conf.env.O_EXT = "obj":

(reduced the log text for readability by using ...)

11:22:53 runner ['...\\CL.exe',  ... , '/Fo...\\test.cpp.1.o']
11:22:54 runner ['...\\LINK.exe', ... 'test.cpp.1.o', ...]

Merge request reports