Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: earlgrey on January 10, 2016, 09:17:38 am

Title: bug :: virual target rebuild : targets cleanup
Post by: earlgrey on January 10, 2016, 09:17:38 am
If you make a virtual target, and rebuild it, targets are cleaned BEFORE all the targets builds ; so the first target build is correct, but starting from the second target build, the .o files of the first target build are re-used.
 
Code
-------------- Clean: devel-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
Cleaned "cb-oflp-plugin - devel-ms"

-------------- Clean: debug-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
Cleaned "cb-oflp-plugin - debug-ms"

-------------- Clean: release-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
Cleaned "cb-oflp-plugin - release-ms"

-------------- Build: devel-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -g -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DBUILDING_PLUGIN {...} -o obj\src\oflp-log.o
{...}
mingw32-g++.exe -g -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DBUILDING_PLUGIN {...} -o obj\src\oflp-settings.o
mingw32-g++.exe -shared   -Wl,--dll {...} -o plugin\devel\ms\x32_4.9.2\OpenFilesListPlus.dll -mthreads -fmax-errors=0  -lcodeblocks -lwxmsw28u
Output file is plugin\devel\ms\x32_4.9.2\OpenFilesListPlus.dll with size 4.12 MB
Running target post-build steps
{...}

-------------- Build: debug-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
{ MISSING MODULES COMPILATION HERE }
mingw32-g++.exe -shared   -Wl,--dll {...} -o plugin\devel\ms\x32_4.9.2\OpenFilesListPlus.dll -mthreads -fmax-errors=0  -lcodeblocks -lwxmsw28u
Output file is plugin\debug\ms\x32_4.9.2\OpenFilesListPlus.dll with size 4.12 MB
Running target post-build steps
{...}

-------------- Build: release-ms in cb-oflp-plugin (compiler: GNU GCC Compiler)---------------
{ MISSING MODULES COMPILATION HERE }
mingw32-g++.exe -shared   -Wl,--dll {...} -o plugin\devel\ms\x32_4.9.2\OpenFilesListPlus.dll -mthreads -fmax-errors=0  -lcodeblocks -lwxmsw28u
Output file is plugin\release\ms\x32_4.9.2\OpenFilesListPlus.dll with size 4.12 MB
Running target post-build steps
{...}

Process terminated with status 0 (0 minute(s), 22 second(s))
0 error(s), 0 warning(s) (0 minute(s), 22 second(s))
In the rebuild process, each target cleanup should occur just before the target build.
Title: Re: bug :: virual target rebuild : targets cleanup
Post by: MortenMacFly on January 10, 2016, 10:40:31 am
If you make a virtual target, and rebuild it, targets are cleaned BEFORE all the targets builds ; so the first target build is correct, but starting from the second target build, the .o files of the first target build are re-used.
To my knowledge thats an option you can change in the compiler options... Can't look ATM - no C::B at hand.
Title: Re: bug :: virual target rebuild : targets cleanup
Post by: earlgrey on January 10, 2016, 10:46:37 am
Apologizes, you are right, it is in :
Global compiler settings -> build Options -> Rebuild workspace / project
Title: Re: bug :: virual target rebuild : targets cleanup
Post by: oBFusCATed on January 10, 2016, 11:37:49 am
Generally it is better to setup your targets to output object files in different directories.
So in the future if we add parallel compilation of targets they'll still build fine.