Relative include paths

Everything about development and the OpenMW source code.
Post Reply
Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Relative include paths

Post by Allofich »

Using Microsoft Visual Studio 2015, there is a flood of warnings about relative include paths in OpenMW's source code.

It seems like an easy fix, just changing e.g. #include "../mwbase/world.hpp" to #include "apps/openmw/mwbase/world.hpp"
but maybe there is a reason why making this change is undesirable?

For anyone who is using Microsoft Visual Studio 2015 like me, it would be nice to clear some of the junk out of the way of the warning message log so we can see more important messages, so I would like to fix these in files I contribute to, but is there a problem with this? Thanks.
Last edited by Allofich on 17 Jun 2016, 18:36, edited 1 time in total.
User avatar
psi29a
Posts: 5089
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Relative include paths

Post by psi29a »

do it, make a pull request and we'll see what travis-ci and appveyor says :)
Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: Relative include paths

Post by Allofich »

Sure, I'll give it a shot, then.
Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: Relative include paths

Post by Allofich »

Everything worked fine with the travis and appveyor compilers, but after giving the issue a fresh consideration, I think this might not be a productive direction to go. While it would be nice to cut down on the Microsoft Visual Studio warnings, it may be better to only worry about warnings generated from things like the travis and appveyor builds that are easily accessible to everyone working on the project. Any thoughts? I'm leaning toward closing my pull request of Microsoft Visual Studio warning fixes.
Chris
Posts: 1597
Joined: 04 Sep 2011, 08:33

Re: Relative include paths

Post by Chris »

Is it possible to disable that specific warning with MSVC? I don't imagine it'd be a problem to modify the cmake scripts to add the switch to disable the 'relative include path' warning.
Allofich
Posts: 104
Joined: 28 May 2016, 12:50

Re: Relative include paths

Post by Allofich »

You can set a warning level so that the relative path warning, along with other warnings, will not show up any more. It's also supposedly possible to suppress a specific warning.
https://msdn.microsoft.com/en-us/library/jj715718.aspx

Anyway I was told that include paths with .. are preferable, so I closed the pull request.
Post Reply