Currently meson only considers what compiler/linker were used by a Target's immediate sources or objects, not the sources of libraries it's linked with by the link_with and link_while keywords. This means that if given 3 libraries: libA which is C++, libB which is C, and libC which is also C, and libC links with libB which links with libA then linking libC will be attempted with the C linker, and will fail. This patch corrects that by adding the compilers used by sub libraries to the collection of compilers considered by meson when picking a linker. This adds a new process_compilers_late method to the BuildTarget class, which is evaluated after process_kwargs is called. This is needed because some D options need to be evaluated after compilers are selected, while for C-like languages we need to check the link* targets for language requirements, and link* targets are passed by kwargs. This implementation is recursive, since each Target adds it's parent's dependencies.pull/2326/head
parent
59a90309ab
commit
d5003c2190
5 changed files with 105 additions and 9 deletions
@ -0,0 +1,19 @@ |
||||
/* Copyright © 2017 Dylan Baker
|
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
#include "sub.h" |
||||
|
||||
float a_half(void) { |
||||
return .5; |
||||
} |
@ -0,0 +1,16 @@ |
||||
/* Copyright © 2017 Dylan Baker
|
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
float a_half(void); |
Loading…
Reference in new issue