[CMake] Watcom Support

J Decker d3ck0r at gmail.com
Mon Mar 8 00:06:05 EST 2010


Ooops, missed a linker line that needed <LINK_FLAGS> added.
Also, apparently, the _DEBUG_ modes of C flags dropped the -d2 for
writing debug info out.  Attattched modified windows-wcl386.cmake.

On Sun, Mar 7, 2010 at 4:39 PM, J Decker <d3ck0r at gmail.com> wrote:
> Uhmm... okay a thing that would help a LOT
>
> adding <LINK_FLAGS> to CMAKE_C_LINK_EXECUTABLE in windows-wcl386.cmake
>
>
>
> # additional definitions that work, when <LINK FLAGS> is part of the link rule
> SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
> SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
> SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
> SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
>
> set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" )
>
> set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
> SET(CMAKE_CREATE_CONSOLE_EXE "system nt" )
>
> #can set this... until it's actually usable...
> SET(CMAKE_RC_COMPILER "rc" )
>
>
> # adds <LINK_FLAGS>
> SET(CMAKE_C_LINK_EXECUTABLE
>    "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name
> '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>}
> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
>
>
>
>
> I'd love to add -bt${CMAKE_WATCOM_WMAKE_TARGET_SYSTEM} where
>
> set_property(CACHE CMAKE_WATCOM_WMAKE_TARGET_SYSTEM PROPERTY STRINGS
>               "" "=NT" "=OS2" "=DOS" "=QNX" )
>
>
> SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs -bt${CMAKE_WATCOM_WMAKE_TARGET_SYSTEM}")
> SET (CMAKE_C_FLAGS_INIT "-w=3 -xs -bt${CMAKE_WATCOM_WMAKE_TARGET_SYSTEM}")
>
>
>
>
> On Sat, Mar 6, 2010 at 8:20 PM, J Decker <d3ck0r at gmail.com> wrote:
>>> Is there
>>>
>>> CMAKE_C_FLAGS_EXE_INIT and CMAKE_C_FLAGS_SHARED_INIT ?
>>>
>> Sorta... apparently there is CMAKE_SHARED_LIBRARY_C_FLAGS
>> but as far as I can tell CMAKE_EXECUTABLE_C_FLAGS doesn't exist or
>> isn't ever used.
>>
>> Also under watcom, these options in windows-cl.cmake
>>
>> SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
>> SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
>>
>> are not passed to watcom linker.
>>
>> But then this leads me to say that really CMAKE_WIN32_C_FLAGS and
>> CMAKE_CONSOLE_C_FLAGS are useful :)
>>
>>
>>
>>
>>> I also just tried exporting the blow mentioned values on 2.8.1-RC4,
>>> with the same result.
>>>
>>> (sory to branch conversation to 3 heads)
>>>
>>> On Fri, Mar 5, 2010 at 6:15 AM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>>>> J Decker wrote:
>>>>>
>>>>> but then, for every project that already exists, it won't build
>>>>> correctly using watcom, because the options just aren't set in the
>>>>> generator, or 3 more flavors of generators aren't added to support
>>>>> static library, executlable and dynamic library with correct compile
>>>>> time options.
>>>>>
>>>>
>>>> It should go in Modules/Platform/Windows-wcl386.cmake.
>>>>
>>>> Just set these:
>>>> CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT
>>>> CMAKE_SHARED_LINKER_FLAGS_INIT
>>>> CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT
>>>>
>>>>
>>>> See Windows-cl.cmake for an example, you will also want to set
>>>> RELWITHDEBINFO to have the same flag.  If you can verify this works, I will
>>>> merge into git master for CMake.
>>>>
>>>> -Bill
>>>>
>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Windows-wcl386.cmake
Type: application/octet-stream
Size: 3905 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100307/5a4ba690/attachment.obj>


More information about the CMake mailing list