wxArrayString DirectCommands::GetTargetLinkCommands(ProjectBuildTarget* target, bool force) const
{
[...]
bool IsOpenWatcom = target->GetCompilerID().IsSameAs(_T("ow"));
[...]
if (IsOpenWatcom && target->GetTargetType() != ttStaticLib)
linkfiles << _T("file ");
[...]
This does not look good...
Possible patch that needs tested by a person using Open Watcom.
Index: src/plugins/compilergcc/directcommands.cpp
===================================================================
--- src/plugins/compilergcc/directcommands.cpp (revision 9936)
+++ src/plugins/compilergcc/directcommands.cpp (working copy)
@@ -677,8 +677,6 @@
ret.Add(wxString(COMPILER_SIMPLE_LOG) + _("Linking stage skipped (build target has no object files to link)"));
return ret;
}
- if (IsOpenWatcom && target->GetTargetType() != ttStaticLib)
- linkfiles << _T("file ");
bool subseq(false);
for (unsigned int i = 0; i < files.GetCount(); ++i)
{
Index: src/plugins/compilergcc/resources/compilers/options_ow.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/options_ow.xml (revision 9936)
+++ src/plugins/compilergcc/resources/compilers/options_ow.xml (working copy)
@@ -436,15 +436,15 @@
<Command name="CompileResource"
value="$rescomp -q -r -fo=$resource_output $res_includes $file"/>
<Command name="LinkExe"
- value="$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects"/>
+ value="$linker option quiet $link_options $libdirs file $link_objects name $exe_output $libs $link_resobjects"/>
<Command name="LinkConsoleExe"
- value="$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects"/>
+ value="$linker option quiet $link_options $libdirs file $link_objects name $exe_output $libs $link_resobjects"/>
<Command name="LinkDynamic"
- value="$linker option quiet $link_options $libdirs name $exe_output $libs $link_objects"/>
+ value="$linker option quiet $link_options $libdirs name $exe_output $libs file $link_objects"/>
<Command name="LinkStatic"
value="$lib_linker -q $static_output $link_objects"/>
<Command name="LinkNative"
- value="$linker option quiet $link_options $libdirs $link_objects name $exe_output $libs $link_resobjects"/>
+ value="$linker option quiet $link_options $libdirs file $link_objects name $exe_output $libs $link_resobjects"/>
<Common name="cmds"/>
<RegEx name="Note"
I did only very minor testing using OpenWatcom 32 bit.
Tim S.
Hi, thanks for your assistance.
I've tried to create a small example that illustrates my challenge:
A library called MyLib includes two source files (types and calc). MyLib is then used by MyProg.exe through a handler. It is essential that both the library and the application consists of more than one source file. Otherwise there are no obj files to separate.
wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\types.obj types.c
wcl.exe -q -c -d2 -wx -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calc.obj calc.c
wlib.exe -q MyLib.lib obj\Debug\types.obj obj\Debug\calc.obj
wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\main.obj main.c
wcl.exe -q -c -ml -bt=dos -bcl=dos -iC:\WATCOM\h -fo=obj\Debug\calcHandler.obj calcHandler.c
wlink.exe name MyProg.exe d all sys dos op m op maxe=25 op q LIBP C:\WATCOM\lib386;C:\WATCOM\lib386\dos FIL main.obj,calcHandler.obj library ..\MyLib\bin\Debug\MyLib.lib,lib\OtherLib.lib
The list of obj files sent to wlib.exe is separated by spaces. But for wlink it needs to be separated by commas.
Of course I have the option to create another copy of the compiler profile and have one setup for compiling library projects and another for exe projects.
Best regards
Emil