In SpellChecker_wx31*.cbp, svn 11488, this line (n° 63) :
<Variable name="WX_VERSION" value="28" />
is probably wrong. It should be value="31".
Nevertheless, compilation works as expected, so may be this line is not used.
gd_on
Here is the build log of rev11488 of spell check 32bit wx31 project(SpellChecker_wx31.cbp).
About the linker option, only the last target is need the linking option "-lwxmsw31u", the other targets do not need this linker options, so WX_VERSION is only used in the last target. The other targets are just using the ar.exe to achieve the object files.
About the compiler option when building the first target named "hunspell"
[ 5.0%] g++.exe -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -std=gnu++11 -g -O0 -pipe -mthreads -fmessage-length=0 -fexceptions -DHUNSPELL_STATIC -Iwxspellchecker\include -IE:\wxWidgets-3.1.1-rc\include -IE:\wxWidgets-3.1.1-rc\lib\gcc_dll\mswu -Ihunspell\src\hunspell -Ihunspell\ -c hunspell\src\hunspell\affentry.cxx -o ..\..\..\.objs31\plugins\contrib\SpellChecker\hunspell\hunspell\src\hunspell\affentry.o
I see in the target's compiler option, there is a line:
$(#WX31.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)
But the WX_CFG and WX_SUFFIX is not defined in the target level. I also don't find those variables in project level.
So, how does those custom variables expand? Maybe, I just build the CodeBlocks_wx31.cbp, and the custom variables are cached?
I just testing building SpellChecker wx3.1.x under C::B(rev11488), and here is the log(see attachment file):
-------------- Build: hunspell in SpellChecker wx3.1.x (compiler: GNU GCC Compiler)---------------
g++.exe -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -std=gnu++11 -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHUNSPELL_STATIC -DTEST -Iwxspellchecker\include -IE:\wxWidgets-3.1.1-rc\include -IE:\wxWidgets-3.1.1-rc\lib\gcc_dll\msw -Ihunspell\src\hunspell -Ihunspell\ -c D:\code\cb\cb_sf_git\clean-trunk-for-commit\src\plugins\contrib\SpellChecker\hunspell\src\hunspell\affentry.cxx -o ..\..\..\.objs31\plugins\contrib\SpellChecker\hunspell\hunspell\src\hunspell\affentry.o
You see, the path is
-IE:\wxWidgets-3.1.1-rc\lib\gcc_dll\msw
And you can see the "u" is missing compared with the build log I build SpellChecker wx3.1.x under C::B(rev11210).
Maybe, this commit cause the difference:
Revision: 1ce96228a102fb0e2acc587d1984ee2a3039ac59
Author: fuscated <fuscated@2a5c6006-c6dd-42ca-98ab-0921f2732cef>
Date: 2018/9/12 6:38:32
Message:
* compiler: Clear target specific variables from the MacroManager on every recalculation (ticket #582, thanks bluehazzard)
> The problem with the old version is that if a certain variable is defined
only in one target (A) and not in the others. If the target A is built
first the variable will be stored in the marco manager and then the
variable will be available for the other targets.
> This is probably incorrect and unwanted. I'm sure we'll break someones
build, but probably this hopefully would find an error in their setup.
> To reproduce the problem try the following:
1. Create a project with 3 targets (A, B, C).
2. Add them to a virtual target. Beware of order.
3. Add the same variable to targets A and B. Make sure target B doesn't
define the variable
4. Add a define like MYVAR=$(VAR) to the project options.
5. Rebuild the virtual target.
6. Inspect the build log. You should see that for target B there is
something like -DMYVAR= so the $(VAR) should be expanded to empty
string.
> Note: This is surely not the most efficient solution. But the marco
manager needs a revision anyway to improve build performance.
> Note: Build regressions due to inefficiencies are most visible in clean
builds.
git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11465 2a5c6006-c6dd-42ca-98ab-0921f2732cef
Better with svn 11494.
Nevertheless, as mentioned by ollydbg, there is still an incorrect include for the target hunspell :
-IC:\wxWidgets-3.1.1\lib\gcc_dll\msw
which does not exist.
It should be -IC:\wxWidgets-3.1.1\lib\gcc_dll\mswu. Other targets have the right include.
If it works, it's probably because this include folder is not necessary.
gd_on
...
If it works, it's probably because this include folder is not necessary.
Hi, gd_on, thanks for the test.
I'm agree with you, here is patch which I remove the unnecessary compiler search paths from the first build target, can you give a try? It works fine here.
-------------- Build: hunspell in SpellChecker wx3.1.x (compiler: GNU GCC Compiler)---------------
g++.exe -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -std=gnu++11 -g -pipe -mthreads -fmessage-length=0 -fexceptions -DHUNSPELL_STATIC -DTEST -Ihunspell\src\hunspell -Ihunspell\ -c D:\code\cb\cb_sf_git\clean-trunk-for-commit\src\plugins\contrib\SpellChecker\hunspell\src\hunspell\affentry.cxx -o ..\..\..\.objs31\plugins\contrib\SpellChecker\hunspell\hunspell\src\hunspell\affentry.o
...
BTW: some macro definition like "__WXMSW__" is defined in the project level, and in-fact, they are not needed here to build the hunspell target. But my patch doesn't remove those macro definitions.
src/plugins/contrib/SpellChecker/SpellChecker_wx31.cbp | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/plugins/contrib/SpellChecker/SpellChecker_wx31.cbp b/src/plugins/contrib/SpellChecker/SpellChecker_wx31.cbp
index f449ffde..8c34f248 100644
--- a/src/plugins/contrib/SpellChecker/SpellChecker_wx31.cbp
+++ b/src/plugins/contrib/SpellChecker/SpellChecker_wx31.cbp
@@ -21,9 +21,6 @@
<Add option="-fmessage-length=0" />
<Add option="-fexceptions" />
<Add option="-DHUNSPELL_STATIC" />
- <Add directory="wxspellchecker/include" />
- <Add directory="$(#WX31.include)" />
- <Add directory="$(#WX31.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
<Add directory="hunspell/src/hunspell" />
<Add directory="hunspell/" />
</Compiler>
The wxSpellChecker target needed WX_SUFFIX to be defined in order to find the wx/setup.h when compiling (not related to linking)
I think you are right, that commit broke the build of the target because the project's configuration was flawed beforehand.
EDIT: mortenmcfly fixed the CBP some minutes ago and closed ticket 744 again.
Yes, I agree with you. wxSpellChecker is the second build targets which does need wx header files. OBF's commit rev11465 just clear all the previous targets custom variables' value when building a new targets, so all the cached values are cleaned.
I'm going to commit the above patch to make things more clean.