Menu

#764 Slashes in Makefile path converted to local filesystem style

Undefined
open
nobody
None
Undefined
2018-11-20
2018-11-13
Walt
No

On Windows 7:
Configure a project to use custom makefile
Set path to makefile using unix style slahses, e.g. ~/myMakefile.mk
Save, close and reopen project
Observe the slashes have changed to backslashes

This causes problems when using cygwin compiler which expects unix style paths.
Note: Changing the values back to forward slashes makes the project work (compile) okay until after next save / load cycle. Work-around is to change these settings everytime the project is opened.
This may be similar to #36.

Discussion

  • Jannick

    Jannick - 2018-11-14

    This is a nasty issue I addressed a couple of times already.

    Workaround: enclose the path in $TO_UNIX_PATH{...} - then CB can do to slashes whatever it wants. That helped me many times.

     
  • bluehazzard

    bluehazzard - 2018-11-17

    The question is how to solve this. Codeblocks project should work on any system, so path separators have to be converted to the system local. So how to solve this? Introduce an other option? I do not think this is the right way. Using this macro seems to be an ok way?

     
  • Jannick

    Jannick - 2018-11-20

    There is no new option needed. You can request the compiler use forward slashes in paths only:

    • Settings > Compiler > (Select compiler >) tab 'Other settings' > button 'Advanced Options' > tab 'Others' > check box 'Force use of forward slashes as path separator'.

    Using this configuration makes the workaround I proposed above obsolete. Paths are saved with forward slashes in the project file, in particular (tested on Win10, CB nighlty Nov 2018). Note that the configuration is compiler specific.

    @Walt: Does this work for you?

     
  • Walt

    Walt - 2018-11-20

    That (well hidden) option is already selected so it does not seem to set the required behaviour, i.e. the makefile path is still saved with backslashes.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.