bradking wrote:
@DavidTruby thanks. This LGTM now. I've locally updated CMake to use the
preprocessor definitions in place of the workaround we had before, and it seems
to work with this PR.
https://github.com/llvm/llvm-project/pull/73250
___
cfe
@@ -322,6 +345,7 @@ void Flang::addTargetOptions(const ArgList &Args,
if (Triple.isKnownWindowsMSVCEnvironment()) {
processVSRuntimeLibrary(TC, Args, CmdArgs);
+addVSDefines(TC, Args, CmdArgs);
}
// TODO: Add target specific flags, ABI, mtune option etc.
@@ -322,6 +345,7 @@ void Flang::addTargetOptions(const ArgList &Args,
if (Triple.isKnownWindowsMSVCEnvironment()) {
processVSRuntimeLibrary(TC, Args, CmdArgs);
+addVSDefines(TC, Args, CmdArgs);
}
// TODO: Add target specific flags, ABI, mtune option etc.
@@ -204,6 +204,29 @@ void Flang::AddAArch64TargetArgs(const ArgList &Args,
}
}
+static void addVSDefines(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs) {
+
+ unsigned ver = 0;
+ const VersionTuple vt = TC.computeMSVCVersion(null
bradking wrote:
This file has CRLF newlines. Is that expected?
https://github.com/llvm/llvm-project/pull/73250
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
bradking wrote:
@DavidTruby that fixed it, thanks. Nice work. I've locally updated CMake to
use `flang-new`'s MSVC runtime library selection flags
(`-fms-runtime-lib={static,static_dbg,dll,dll_dbg}`). It passes CMake's test
suite, including the `MSVCRuntimeLibrary.Fortran` test that covers
bradking wrote:
I tried this locally, but it doesn't quite work:
```
>flang-new foo.f90
... fatal error LNK1276: invalid directive 'clang_rt.builtins-x86_64.lib'
found; does not start with '/'
```
The directives appear in the object file with an extra space:
```
>flang-new -c foo.f90
>grep -a
bradking wrote:
@DavidTruby please see my above retraction of the suggestion to rename
`.dynamic.lib` to `.dll.lib`.
https://github.com/llvm/llvm-project/pull/70833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
@@ -281,3 +281,26 @@ add_flang_library(FortranRuntime
INSTALL_WITH_TOOLCHAIN
)
+
+if (DEFINED MSVC)
+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
+ add_flang_library(FortranRuntime.static ${sources}
bradking wrote:
When targeting the MSVC ABI, the plain
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
https://github.com/bradking edited
https://github.com/llvm/llvm-project/pull/70833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
@@ -1,3 +1,21 @@
add_flang_library(Fortran_main STATIC INSTALL_WITH_TOOLCHAIN
Fortran_main.c
)
+if (DEFINED MSVC)
+add_flang_library(Fortran_main.static STATIC INSTALL_WITH_TOOLCHAIN
+Fortran_main.c
+)
bradking wrote:
The style elsewhere
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
@@ -281,3 +281,26 @@ add_flang_library(FortranRuntime
INSTALL_WITH_TOOLCHAIN
)
+
+if (DEFINED MSVC)
+ add_flang_library(FortranRuntime.static ${sources}
+LINK_LIBS
+FortranDecimal.static
+INSTALL_WITH_TOOLCHAIN)
+ set_property(TARGET FortranRuntime.static PROPE
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
@@ -53,3 +53,26 @@ add_flang_library(FortranDecimal INSTALL_WITH_TOOLCHAIN
binary-to-decimal.cpp
decimal-to-binary.cpp
)
+
+if (DEFINED MSVC)
+ set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
bradking wrote:
`add_flang_library` eventually ends up in `llvm/c
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
https://github.com/bradking edited
https://github.com/llvm/llvm-project/pull/70833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs,
const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
https://github.com/bradking requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/70833
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
brad.king added a comment.
> the feasibility of emitting 'arguments' instead of 'command' into the JSON
> compilation database.
CMake constructs the command lines internally using string replacement on
templates. We never actually know the exact arguments. Therefore providing
arguments inst
brad.king added a comment.
I do not think MSVC starts off with an empty line with -showIncludes
specifically. It is just that MSVC unconditionally prints the name of the
source file first. This means that any showIncludes output is naturally
preceded by a newline because at least one other li
On 10/20/2015 04:38 AM, Manuel Klimek wrote:
> On Tue, Oct 20, 2015 at 5:52 AM Sean Silva wrote:
>> get cmake to generate clang module map files and add explicit module build
>> steps?
>
> I have some experience hacking on cmake, and from my experience I think
> this shouldn't be too hard to get
26 matches
Mail list logo