Re: Cygwin g++ for 'make depend'

"'Gisle Vanem' via wx-users" <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
>  I guess it's due to filtering out -D__WXMSW__ from your CFLAGS above

I don't. Did you notice the *$(filter -%I -%D, $(CFLAGS))..*?. And I use 
*-FI./$(OBJ_DIR)/config.h* for *cl* and *clang-cl*
and I really saw no need to add *-D__WXMSW__* for those. But adding it 
seems to do no harm.
Hence my */$(OBJ_DIR)/**config.h* and *depend hack* is now:
  #define __WXMSW__        1
  #if defined(GCC_MAKE_DEPEND)
    #define _MSC_VER            1910
    #define _WX_CHKCONF_H_      1
    #define _WX_MSW_CHKCONF_H_  1
  #endif

mandag 12. februar 2024 kl. 13:19:50 UTC+1 skrev Vadim Zeitlin:

> On Mon, 12 Feb 2024 03:00:16 -0800 (PST) Gisle Vanem wrote:
>
> GV> In my a GNU-makefile (targeting MSVC), I sometimes use a Cygwin 'g++'
> GV> to create dependencies. Like:
> GV> DEP_CFLAGS = -MM $(filter -I% -D%, $(CFLAGS)) \
> GV> --include $(OBJ_DIR)/config.h \
> GV> -DGCC_MAKE_DEPEND
> GV> depend:
> GV> g++ $(DEP_CFLAGS) $(SOURCE) >> .depend.Windows
>
> Note that this is not going to work for anything conditionally-included
> depending on the compiler used.
>
> GV> But when a wxWidget headers notice a '__GNUC__' and/or '__CYGWIN__' is 
> GV> involved,
> GV> it goes bananas with huge amounts of '#error' statements. 
>
> I guess it's due to filtering out -D__WXMSW__ from your CFLAGS above, why
> do you do it?
>
> GV> So I just fake 'g++' into a MSVC-compiler in my generated
> GV> '$(OBJ_DIR)/config.h':
> GV> #if defined(GCC_MAKE_DEPEND)
> GV> #define _MSC_VER 1910
> GV> #define WX CHKCONF H 1
> GV> #define WX MSW CHKCONF H 1
> GV> #define __WXMSW__ 1
> GV> #endif
> GV> ....
> GV> --------------
> GV> 
> GV> Is there a better way?
>
> You could predefine the same symbols on command line, but it's still a
> dirty hack, of course.
>
> Regards,
> VZ
>
> -- 
> TT-Solutions: wxWidgets consultancy and technical support
> https://www.tt-solutions.com/
>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/f8a6d575-8305-4318-9359-445ad275e2b3n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.