[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--fmodule-output` (PR #121046)
Sharadh Rajaraman via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 10 12:22:31 PST 2025
================
@@ -14,3 +14,11 @@
//--- test.pcm
// CPP20WARNING-NOT: clang-cl: warning: argument unused during compilation: '/std:c++20' [-Wunused-command-line-argument]
+
+// test whether the following outputs %Hello.bmi
+// RUN: %clang_cl /std:c++20 --precompile -x c++-module -fmodule-output=%t/Hello.bmi -Fo"%t/Hello.bmi" -c %t/Hello.cppm -### 2>&1 | FileCheck %s
----------------
sharadhr wrote:
> This is just one invocation, but the logic in GetNamedOutputPath() seems to cover many cases.
Agreed; once again; open to suggestions for more test cases.
> Also, is it -fmodule-output or /Fo that sets the output filename (or both?)
>From the [Clang user guide](https://clang.llvm.org/docs/StandardCPlusPlusModules.html#how-to-build-projects-using-modules), it appears _both_ are required, and CMake in particular uses the 'one-phase compilation' method.
https://github.com/llvm/llvm-project/pull/121046
More information about the cfe-commits
mailing list