[llvm-bugs] [Bug 44444] New: Lacking support of output directory when compiling multiple source file

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 2 08:08:17 PST 2020


            Bug ID: 44444
           Summary: Lacking support of output directory when compiling
                    multiple source file
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: or.kunst at incredibuild.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Even though clang supports multiple source files as input, it does not allow
specifying an output directory, where to locate the generated object files,
meaning it forces the user to put it in current directory.
For example, in case of building a project that consists of 3 source files:
1.cpp, 2.cpp, 3.cpp, and wishing to put the generated object file in a specific
directory, forces you the call each clang process individually with its source
and output file name: 
- clang.exe -g -o ".\myproj\debug\1.obj" 1.cpp
- clang.exe -g -o ".\myproj\debug\2.obj" 2.cpp
- clang.exe -g -o ".\myproj\debug\3.obj" 3.cpp

A better solution (in my humble opinion) is to call clang once, with all input
files, specifying the directory where to save the output files:
- clang.exe -g -o ".\myproj\debug" 1.cpp 2.cpp 3.cpp 

I'm aware that under Linux everything is considered as file, therefor
specifying output directory might be mistakenly considered as an output file,
but i'm sure there's a good way to workaround that.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200102/e84d5af9/attachment-0001.html>

More information about the llvm-bugs mailing list