[GRADLE-2923] Files with identical names in C/C++ source tree are silently excluded from compilation. Created: 16/Oct/13 Updated: 13/Mar/14 Resolved: 13/Mar/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 1.12-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | René Gröschke (Inactive) |
Resolution: | Fixed | Votes: | 3 |
Description |
I've ran into a problem that appears when a native build tree contains source files with same name placed in different directories. It appears that Gradle directs compilation output for the whole tree into a single directory and names of the object files come into clash. Here's the example tree: ├── build.gradle Files `foo.h` and `foo.cpp` under subdirectories `foo1` and `foo2` declare and define functions `foo1()` and `foo2()`; both are called from `main.cpp`. The build.gradle just defines the executable: apply plugin: 'cpp' executables { When `gradle mainExecutable` is called, linker shows undefined reference to `foo2()`, even though compilation step went smoothly. Is there a way to solve that without renaming files? It's not always possible or desirable. |
Comments |
Comment by Julien Jean Paul Sirocchi [ 13/Mar/14 ] |
This bug bit me in my mixed Java/Scala project. Initially, it was my belief that it was a problem with the Scala plugin but having found this issue I guess that assumption was wrong. Here's an example: https://github.com/sirocchj/name-clash |
Comment by René Gröschke (Inactive) [ 13/Mar/14 ] |
At Julien, cheers, |