Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Directory separator in project file (.cbp)

<< < (2/6) > >>

MortenMacFly:
...here comes an alternative patch accordingly.

Edit: Patch updated (see more recent post).

Hadomunt:
Seems like most practical thing to do is to use:
- Relative paths as much as possible
- Automatically convert the directory separator.

We should have codeblocks checking on which platform it is in and use/change the separators accordingly.
With standardizing path description internally we could avoid things switching constantly I guess?
(Modifying them to correct representation when giving to other applications/command line?)

MortenMacFly:

--- Quote from: Hadomunt on July 27, 2012, 06:42:42 pm ---Seems like most practical thing to do is to use:
- Relative paths as much as possible
- Automatically convert the directory separator.

--- End quote ---
That's how it is now and what was complained. ::)

If that's OK we don't need to change anything. ???

Jenna:

--- Quote from: MortenMacFly on July 28, 2012, 03:13:32 pm ---
--- Quote from: Hadomunt on July 27, 2012, 06:42:42 pm ---Seems like most practical thing to do is to use:
- Relative paths as much as possible
- Automatically convert the directory separator.

--- End quote ---
That's how it is now and what was complained. ::)

If that's OK we don't need to change anything. ???

--- End quote ---

If I understand the post correctly the conversion should only be done if we call any external programs, like compiler, linker etc. , but internally (especially in project- and workspace-files) use the same syntax on all platforms.
This might probaly lead to problems with (windows-) parameters that get saved in the project-file, because they also use a slash in many (most?) cases.

MortenMacFly:

--- Quote from: jens on July 28, 2012, 03:26:53 pm ---If I understand the post correctly the conversion should only be done if we call any external programs, like compiler, linker etc. , but internally (especially in project- and workspace-files) use the same syntax on all platforms.

--- End quote ---
Ah, OK... ::)


--- Quote from: jens on July 28, 2012, 03:26:53 pm ---This might probaly lead to problems with (windows-) parameters that get saved in the project-file, because they also use a slash in many (most?) cases.

--- End quote ---
That what my approach tries to avoid: I only change path's we can change safely w/o interfering with tools not supporting it (although I have to admit that I never tried to compile a file using MSVC with this patch applied). For Windows, you cannot easily convert all back-slashes to slashes. For this I see no way - just consider this command line:
mytool.exe /lflag C:\Foo\Bar \\server\baz /DDEF
How would you safely do the right thing here? Impossible.

The main request was out of the fact that if you saved a cross-platform project with Windows and then with Unix the files are different. With the patch presented here they wouldn't. I honestly think that's all we can do. Everything else is just too risky and would certainly work on the one hand, but break a feature on the other.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version