Search code examples
cwindowsstatic-librariescodeblocks

Dependencies not being built from command line execution with Code::Blocks


This is all within a Windows environment.

I have a main project that depends on 2 libraries (e.g. lib.a). When I rebuild through the Code::Blocks IDE, it cleans both library projects and the main project as expected. It then builds all 3 projects, libraries first, as expected with no issues.

I try to do the same thing from the command line:

"C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" src\emb\bwk\vehicle_monitor\pjt\vehicle_monitor.cbp --target="Release" --rebuild

But it doesn't clean or build the library projects like it does in the IDE, and therefore produces errors:

tricore-g++.exe: error: ..\..\..\..\ext\micro_cdr\result\libmicro_cdr.a: No such file or directory
tricore-g++.exe: error: ..\..\..\..\ext\micro_dds\result\libmicro_dds.a: No such file or directory
Process terminated with status 1 (1 minute(s), 6 second(s))
2 error(s), 39 warning(s) (1 minute(s), 6 second(s))

I tried all command line options and I don't see any log files being produced

C:\>"C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" "Z:\workspace\autoyard\src\emb\bwk\vehicle_monitor\pjt\vehicle_monitor.cbp" --target="Release" --rebuild --log-to-file --debug-log-to-file /d --verbose

Is there something I'm missing on the command line?

Command line options from using --help option: enter image description here


Solution

  • There are 2 answers/conclusions that I was able to come to:

    1. Build the workspace on the command line

      • "C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" "C:\Users\Ryan Gleim\Desktop\CB_workspace.workspace" --target="Release" --rebuild
      • This will build the entire workspace and will build the dependencies in the correct order
      • This won't work for my build system though because we don't have workspaces on the build system
    2. Build each project, in the order required, individually

      • "C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" "Z:\workspace\autoyard\src\ext\micro_cdr\pjt\micro_cdr.cbp" --target="Release" --rebuild
      • "C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" "Z:\workspace\autoyard\src\ext\micro_dds\pjt\micro_dds.cbp" --target="Release" --rebuild
      • "C:\Program Files (x86)\STW\CodeBlocks\codeblocks.exe" "Z:\workspace\autoyard\src\emb\bwk\vehicle_monitor\pjt\vehicle_monitor.cbp" --target="Release" --rebuild
      • This allows the user to control order of builds for dependencies
      • Requires multiple command line commands, but works for a build system that doesn't have a workspace