[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] PCH
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] PCH |
Date: |
Tue, 14 Jun 2016 17:29:47 +0200 |
On Tue, 14 Jun 2016 13:55:38 +0000 Greg Chicares <address@hidden> wrote:
GC> Here's a problem:
GC>
GC> lmi_cli_monolithic$(EXEEXT): $(cli_objects) $(lmi_common_objects)
GC> lmi_cgi$(EXEEXT): $(cgi_objects) $(lmi_common_objects)
GC>
GC> Both $(cgi_objects) and $(cli_objects) include 'main_common.o', so adding
GC> that object file to $(lmi_common_objects) would cause it to be included
GC> twice.
Indeed, sorry for not thinking about the CLI and CGI cases. But for me the
natural thing to do would be to remove main_common.o from c[gl]i_objects
too.
GC> Perhaps the linker would remove duplicates in this case, but maybe
GC> there's another case involving libraries where it wouldn't; we just don't
GC> know. And moving an object file from one list to another to suit the needs
GC> of one compiler results in a haphazard design that, years later, can be
GC> understood only in light of compromises made for pragmatic purposes that
GC> may be forgotten.
I definitely agree that it shouldn't be done just to accommodate some
compiler. IMO it made more sense to put main_common.o into
lmi_common_objects because it wasn't wx-dependent and is meant to never be
because it's, by definition, not interface-specific (unlike e.g. the
*_view.cpp files I changed, which also don't depend on wx interface
currently, but are closely related to it). I think that the same logic
applies to CGI and CLI objects lists as well: main_common.o shouldn't be
part of them because there is nothing CGI- or CLI-specific in it.
If you agree with this logic, all the better. If not, I'll just work
around the PCH problem on my end, it's not a big deal.
GC> I see two possibilities:
GC>
GC> (1) Redo the PCH changes so that the PCH header to be included is given
GC> as a macro
...
GC> (2) Instead of compiling 'main_common.cpp' separately, #include it
GC> in each of the main source files.
FWIW both of these solutions would work, but I don't think it's worth
doing either, I can live with my local workaround for MSVC.
So, again, if you think main_common.o does below to c[gl]i_objects, let's
just not touch anything.
Regards,
VZ
- Re: [lmi] PCH, (continued)
- Re: [lmi] PCH, Vadim Zeitlin, 2016/06/05
- Re: [lmi] PCH, Greg Chicares, 2016/06/05
- Re: [lmi] PCH, Vadim Zeitlin, 2016/06/05
- Re: [lmi] PCH, Greg Chicares, 2016/06/05
- Re: [lmi] PCH, Greg Chicares, 2016/06/06
- Re: [lmi] PCH, Vadim Zeitlin, 2016/06/11
- Re: [lmi] PCH, Greg Chicares, 2016/06/13
- Re: [lmi] PCH, Vadim Zeitlin, 2016/06/13
- Re: [lmi] PCH, Greg Chicares, 2016/06/13
- Re: [lmi] PCH, Greg Chicares, 2016/06/14
- Re: [lmi] PCH,
Vadim Zeitlin <=