Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

RFC: On PCH simplication under Windows

(1/3) > >>

stahta01:
Currently, the building of sdk.h as a Precompiled Header (PCH) requires these defines in the Windows CB Project
__WXMSW__
WXUSINGDLL
wxUSE_UNICODE
CB_PRECOMP
BUILDING_PLUGIN
cbDEBUG
HAVE_W32API_H

I wish to know if patches would likely be accepted to reduce it to these defines?
__WXMSW__
WXUSINGDLL
wxUSE_UNICODE
CB_PRECOMP

Tim S.

 

oBFusCATed:
Can you explain why these defines are required?
Generally I don't like the whole precompiled stuff.
Every time I change a major header everything is recompiled, so annoying...

I would happily remove the pch and rework the headers to be less dependent.

stahta01:

--- Quote from: oBFusCATed on April 07, 2018, 03:03:19 pm ---Can you explain why these defines are required?
Generally I don't like the whole precompiled stuff.
Every time I change a major header everything is recompiled, so annoying...

I would happily remove the pch and rework the headers to be less dependent.

--- End quote ---

From experimentation I think these two rules apply to defines and PCH file usage.
1. If an define is declared while compiling the PCH; then, it must be define while using the PCH.
2. If an [new] define is declared while using the PCH that effects the headers include by the PCH then it will not use the PCH.

The plan to fix the problem is to remove the code effected by defining cbDEBUG and BUILDING_PLUGIN [from the PCH file].
And, just to not define HAVE_W32API_H inside the windows projects. The wxWidgets 3.0 define it in code and it should not cause issues.
Note: It might cause issues in wxWidgets 2.8; did not check it out much in it.

cbDEBUG effects cbexception.h
 The plan is to split part of the code in cbexception.h into a new header cbassert.h
BUILDING_PLUGIN effects cbplugin.h
 The plan is to remove cbplugin.h from sdk_common.h

Both of those two patches will include a lot of files being changed.
The first one I have done a first attempt and I am sure it is likely possible to do.
Just have one small part of the patch that an C++ expert needs to confirm is correct.

The second patch will take a while to create to confirm the idea is valid.

Tim S.

stahta01:
I forgot to mention my solution include creating a target called "pch" to create the PCH file(s).

Tim S.

oBFusCATed:
Why another target? The two files have correct weights...
Do you see any difference in compile times with your changes?
Because if there is not difference I don't see why we should bother at all.

Navigation

[0] Message Index

[#] Next page

Go to full version