Commit Graph

502 Commits

Author SHA1 Message Date
Michael Hirsch, Ph.D 8763d1a584 cleanup rebase of fortraninclude..submod 2019-03-25 08:28:33 -04:00
Michael Hirsch, Ph.D cc4e0b5027 DRY Fortran submodule regex 2019-03-25 08:28:33 -04:00
Michael Hirsch, Ph.D c8342b794b no \b for no-gap non-stantard submodule declaration 2019-03-25 08:28:33 -04:00
Michael Hirsch, Ph.D 41edb6d68f tolerate no-space submodule (non-standard syntax) 2019-03-25 08:28:33 -04:00
Michael Hirsch, Ph.D 434599cc12 Squashed commit of the following:
commit b02b2d6d0d462310b313588ca7705d391e830eeb
Author: Michael Hirsch, Ph.D <scivision@users.noreply.github.com>
Date:   Sun Mar 10 03:51:09 2019 -0400

    cleanup

commit 3311ff5fb12577c78671bf2ff2787d28b86ba5fa
Author: Michael Hirsch, Ph.D <scivision@users.noreply.github.com>
Date:   Sun Mar 10 03:50:30 2019 -0400

    more robust

commit 8030dcb76698b148ee47ecded1f33b6d3821cca2
Author: Michael Hirsch, Ph.D <scivision@users.noreply.github.com>
Date:   Sun Mar 10 03:30:05 2019 -0400

    inwork compiles OK but needs smod filenames
2019-03-25 08:28:32 -04:00
Michael Hirsch, Ph.D 2a830743cc allow fortran submodule to have same name as module 2019-03-25 08:28:32 -04:00
Jussi Pakkanen 8361da5c52 Fix setup so test suite runs with rustc + MSVC. Closes: 5099 2019-03-24 20:56:06 +02:00
Jussi Pakkanen 4e5edff60f Fix Rust global and local args. Closes #5101. 2019-03-22 20:59:33 +02:00
Jussi Pakkanen 3a613564d3
Merge pull request #5116 from dcbaker/openmp-de-specialize
dependencies/openmp: Don't special case OpenMP
2019-03-21 01:21:37 +02:00
Dylan Baker ac627bcea7 replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
2019-03-20 18:45:56 +02:00
Dylan Baker 1f342a2081 dependencies/openmp: Don't special case OpenMP
Currently we specialcase OpenMP like we do threads, with a special
`need_openmp` method. This seems like a great idea, but doesn't work
out in practice, as well as it complicates the opemp
implementation. If GCC is built without opemp support for example, we
still add -fopenmp to the the command line, which results in
compilation errors.

This patch discards that and treats it like a normal dependency,
removes the need_openmp() method, and sets the compile_args attributes
from the compiler.

Fixes #5115
2019-03-19 12:48:22 -07:00
Michael Hirsch, Ph.D 6d215476c0
functionalize per-file Fortran dep scan
allow recursion for Fortran include

qualify include by file extension

correct suffix
2019-03-14 01:43:25 -04:00
Niklas Claesson dd2c44cdf6 Add static as keyword to find_library 2019-03-11 20:56:52 +02:00
Nicolas Schneider ded0defc3f auto generate msvc pch source file if none is provided by the user 2019-03-01 21:50:31 +02:00
Michael Hirsch, Ph.D 39e6dc5885 correct Fortran self-dep logic
corrected, generalized self-referential Fortran fix

further refine logic
2019-02-27 14:08:08 +02:00
Michael Hirsch, Ph.D 32a344b949 Fortran: handle self-referential files 2019-02-26 19:16:50 +02:00
Andrei Alexeyev 2d0841c624 Improve handling of gui_app
This does two things:

 * On windows GCC-like compilers, the subsystem is always explicitly
 specified (either -mwindows or -mconsole). MSVC is already explicit.

 * The gui_app linker flags are now added after those mandated by
 external dependencies. This is because some misguided libraries (such
 as SDL) think that hijacking `main()` and forcing `-mwindows` in link
 flags is clever. We must unconditionally override such misuses to let
 gui_app work as intended.
2019-02-18 22:08:36 +02:00
jml1795 80f16cac8f Fix console log from generator with multiple output nodes 2019-02-18 22:02:15 +02:00
John Ericson d87744138a Remove remaining cross-specific compiler-args code
Since the consolidation of flags in `compiler_options.*`, this
cross/native special casing is not needed.
2019-02-15 09:17:24 -08:00
John Ericson c83b426b0f Remove a useless `cross_args` which is always empty 2019-02-15 09:17:24 -08:00
John Ericson d451a4bd97 Remove get_cross_extra_flags
This is no longer needed, we just remove conditionals around it.
2019-02-15 09:17:24 -08:00
Andrei Alexeyev cc8af259c8 ninja: Always treat PCHs as an implicit dependency
In addition to MSVC, which was worked around previously, GCC also does
not list includes from the PCH in the depfile by default, unless
-fpch-deps is given. I think it's best to stay safe and not rely on any
particular behavior from the compiler here.
2019-02-13 21:24:43 +02:00
Michael Hirsch, Ph.D 627d0d1f3e BUGFIX: ignore non-ascii Fortran characters 2019-02-11 21:26:15 +02:00
Michael Hirsch, Ph.D eccc59874d BUGFIX: handle Fortran 2003 "use" syntax 2019-02-09 00:34:02 +02:00
Jussi Pakkanen 711f73e386
Merge pull request #4860 from nioncode/fixPch
Fix missing PCH dependencies
2019-02-09 00:31:00 +02:00
Michael Hirsch, Ph.D 70e6f4198c Fortran 2008 submodule (#4874) 2019-02-05 22:41:44 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
Nicolas Schneider 3cbc7c7bd9 msvc: fix PCH staleness 2019-02-01 22:28:53 +01:00
Nicolas Schneider 2044bc53b3 use same compiler args for pch as for regular target
Fixes #999, #1415, #2361.
2019-02-01 22:28:52 +01:00
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.

Without this, the linker will fail to link to the library we mistakenly
'found' like so:

ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
2019-01-31 20:36:49 +00:00
Michael Hirsch, Ph.D cccffaa29d BUGFIX: allow fc.run(code) to work, pick only Fortran module 2019-01-29 23:25:23 +02:00
Robert Bragg f2223fcf54 ninjabackend: Adding missing shell quotes for compiler arguments
Since trying to cross compile for Windows from Linux (WSL) and having
paths like this:

  '-L/mnt/c/Program Files (x86)/Microsoft Visual Studio/2017/\
    Community/VC/Tools/MSVC/14.15.26726/lib/x64'

I found that the spaces and brackets in the paths weren't properly
escaped by the Ninja backend.
2019-01-07 23:03:18 +02:00
Daniel Mensinger 4b17bbc753
Better list prepending 2019-01-06 12:19:34 +01:00
Daniel Mensinger b97046ea0f
Fixed hash 2019-01-06 12:19:33 +01:00
Daniel Mensinger bd8bad46c3
Code cleanup and renamed variables 2019-01-06 12:19:33 +01:00
Daniel Mensinger 63e16fbcc3
Fixed flake8 2019-01-06 12:19:32 +01:00
Daniel Mensinger 9742927903
Absolute path generation refactoring 2019-01-06 12:19:32 +01:00
Daniel Mensinger 2487e0a1fb
Simplefied absolute path generation 2019-01-06 12:19:32 +01:00
Daniel Mensinger f75e219297
Simplified code and improved preformance 2019-01-06 12:19:30 +01:00
Daniel Mensinger 7691b0460c
Ninja backend target introspection 2019-01-06 12:19:30 +01:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
John Ericson dbf080afe9 Get rid of `need_cross_compiler`
Building a cross compiler (`build == host != target`) is not cross
compiling. As such, it doesn't make sense to handle it under
`is_cross_build`.

(N.B. Building a standard library for a cross compiler would require
cross compiling, but Meson has support to do such a thing as part of a
compiler build currently.)
2019-01-02 16:11:02 -05:00
Nicolas Schneider 739341ec04 compile pch .h file as c++-header when building a c++ target
Fixes #3641.
2019-01-01 18:57:43 +02:00
Jussi Pakkanen 1fca654055 Add a clang-format target. 2018-12-30 00:50:00 +02:00
Jussi Pakkanen c44a5a1aec Deduplicate export-dynamic and pthread. Closes #4567. 2018-12-06 16:20:54 +02:00
Dylan Baker 9294fd23be backends/ninja: all files in a java target should depend on generated sources
Because java files are both headers and source it's very probably that
generation and compilation will race otherwise.
2018-11-07 14:26:22 -08:00
Phillip Cao fc77ec9243 Get cross_args from the compiler rather than environment directly
This aligns with how the sanity checker gets the args
2018-11-08 00:02:23 +13:00
Jon Turney e57fd01830
Accomodate clang-cl /showIncludes output
Accomodate clang-cl /showIncludes output in detect_vs_dep_prefix().

clang-cl outputs lines terminated with \n, not \r\n

v2:
should invoke the detected compiler, not hardcode 'cl'
2018-11-04 15:42:06 +00:00
Jon Turney 64edfd5069
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX

Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.

v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere

v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well

Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-04 15:42:00 +00:00
Aurélien Zanelli 5af84440bc ninjabackend: add generated source files to jar compile target source list
Otherwise, passing result of custom_target() to jar() target is ignored
and won't be compiled resulting in build fail.
2018-11-02 22:27:25 +02:00