Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-01

Recommended practices for Win / Linux development.

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Donald Ziesig

Hi Everyone!

A long time ago, I tried to develop common software for Windows and Linux.  I remember having problems keeping the object files, etc, separated so that the two versions of Lazarus would re-compile the appropriate files.  I have been working almost exclusively on Linux since then, but now I need to use both with shared source code files.

Are there any recommended practices for setting up Lazarus and various directories that would make this easier?

Thanks,

Don Ziesig

Reply by email

Mattias Gaertner
to Donald Ziesig
Show quoted text 7 lines
Hi Everyone! A long time ago, I tried to develop common software for Windows and Linux.  I remember having problems keeping the object files, etc, separated so that the two versions of Lazarus would re-compile the appropriate files.  I have been working almost exclusively on Linux since then, but now I need to use both with shared source code files.

Shared by svn/git or shared on disk/network share?

Are there any recommended practices for setting up Lazarus and various directories that would make this easier?

By default Lazarus projects use
lib/$(TargetCPU)-$(TargetOS)
as unit output directory.

Mattias

Reply by email

Donald Ziesig
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
On Wed, 10 Jan 2018 19:16:25 -0500 Donald Ziesig via Lazarus wrote: > Hi Everyone! > > A long time ago, I tried to develop common software for Windows and > Linux.  I remember having problems keeping the object files, etc, > separated so that the two versions of Lazarus would re-compile the > appropriate files.  I have been working almost exclusively on Linux > since then, but now I need to use both with shared source code files. Shared by svn/git or shared on disk/network share?

Shared Folders on Dropbox (for now).  GitHub later.

Show quoted text 5 lines
> Are there any recommended practices for setting up Lazarus and various > directories that would make this easier? By default Lazarus projects use lib/$(TargetCPU)-$(TargetOS) as unit output directory.

Got It.

How about Line Endings?

Mattias

Thanks,

Don

Reply by email

Denis Kozlov
to Donald Ziesig: Shared Folders on Dropbox (for now).  GitHub later. Got It. How about Line Endings? Don
Donald Ziesig wrote
How about Line Endings?

You can use system unit constants which will map to the appropriate values on each platform:
System.LineEnding
<https://www.freepascal.org/docs-html/rtl/system/lineending.html> System.DirectorySeparator
<https://www.freepascal.org/docs-html/rtl/system/directoryseparator.html>

Also keep in mind that you can write conditional code aimed at specific
platforms, for example:
{$IFDEF WINDOWS}
   Path := 'C:\Temp\';
{$ELSE}
   Path := '/tmp/';
{$ENDIF}

Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180111/7492eced/attachment.html>

Reply by email

Graeme Geldenhuys
to Donald Ziesig: Shared Folders on Dropbox (for now).  GitHub later. Got It. How about Line Endings? Don
Donald Ziesig wrote
Shared Folders on Dropbox (for now). GitHub later.

Just double check that what goes in does come out. About 2.5 years ago I let Dropbox (Windows client) "backup" my Git repositories. Silently (unknown to me at the time), Dropbox decided to skip some files. So the backups ended up being useless. I ended up using Google Drive instead.

Just something to look out for and test - before you really need to rely on those backups.

On a side note... Git is a "distributed version control system". Every clone is a perfect copy of the repository. So you really don't need Dropbox to share content with others. Others can clone directly from your "public" directory on your machine (eg: in a LAN office environment).

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

R0b0t1
to Donald Ziesig: Hi Everyone! A long time ago, I tried to develop common software for Windows and Linux. …
Donald Ziesig wrote 8 lines
Hi Everyone! A long time ago, I tried to develop common software for Windows and Linux. I remember having problems keeping the object files, etc, separated so that the two versions of Lazarus would re-compile the appropriate files. I have been working almost exclusively on Linux since then, but now I need to use both with shared source code files.

Can you try to remember what happened?

Are there any recommended practices for setting up Lazarus and various directories that would make this easier?

I helped work on a program that was used heavily on both Windows and Linux. We typically did not need to do anything special; as mentioned, the output directories include the target platform. The biggest issue we had was that we used a fair number of non-Lazarus/FPC dependencies, and it ended up being easier, in general, to produce complete installations for Windows from Windows in a lot of cases.

But compiling and cross compiling worked fine. In fact, Lazarus/FPC was the only environment we found or that I know about today that handles platform differences so well.

Cheers,
R0b0t1

Reply by email