Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of commits on other forks #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/meson-cmake-wrapper.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mcw/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def gen_codeblocks_project(self):
'name': 'all',
'id': 'all',
'type': 'custom',
'filename': ''
'filename': ['']
}

for target in [all_target] + self.meson.get_targets():
Expand Down
8 changes: 5 additions & 3 deletions mcw/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,14 @@ def get_output(self, target):
return os.path.join(self.build_dir, self.get_target_filename(target))

def get_target_filename(self, target):
if self.get_version()[1] >= 50:
return target['filename'][0]
filename = target['filename']
if "str" in str(type(filename)):
return filename
else:
return target['filename']
return filename[0]

def get_options(self):

meson_options = []

if self.cross_file:
Expand Down
7 changes: 6 additions & 1 deletion mcw/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def build(self, target):
def get_target(self, target_name):
target = next((t for t in self.meson.get_targets() if t['name'] == target_name), None)
if target:
return target['filename']
# Comment other solution
# target_filename = self.meson.get_target_filename(target)
# base_dirname = os.path.basename(os.path.dirname(target_filename))
# base_filename = os.path.basename(target_filename)
# return os.path.join(base_dirname, base_filename)
return target['name']

return target_name
8 changes: 4 additions & 4 deletions mcw/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def get_include_paths(self, target):
def get_file_groups(self, target):
sources = []
for target_file in self.meson.get_target_files(target):
sources.append(os.path.relpath(target_file, os.path.dirname(target['filename'])))
sources.append(os.path.relpath(target_file, os.path.dirname(self.meson.get_target_filename(target))))
file_group = {
'isGenerated': False,
'sources': sources,
Expand Down Expand Up @@ -300,10 +300,10 @@ def get_project(self):
target['name'] = mtarget['name']
target['fullName'] = mtarget['name']
target['artifacts'] = [
os.path.join(self.meson.build_dir, mtarget['filename'])
os.path.join(self.meson.build_dir, self.meson.get_target_filename(mtarget))
]
target['buildDirectory'] = os.path.join(self.cmake.build_dir, os.path.dirname(mtarget['filename']))
target['sourceDirectory'] = os.path.join(self.cmake.source_dir, os.path.dirname(mtarget['filename']))
target['buildDirectory'] = os.path.join(self.cmake.build_dir, os.path.dirname(self.meson.get_target_filename(mtarget)))
target['sourceDirectory'] = os.path.join(self.cmake.source_dir, os.path.dirname(self.meson.get_target_filename(mtarget)))
target['type'] = type_mapper[mtarget['type']]
target['fileGroups'] = self.get_file_groups(mtarget)
project['targets'].append(target)
Expand Down