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

Have cmake and scons use same lists of source files #882

Merged
merged 2 commits into from
Dec 15, 2016
Merged

Have cmake and scons use same lists of source files #882

merged 2 commits into from
Dec 15, 2016

Conversation

Pentarctagon
Copy link
Member

@Pentarctagon Pentarctagon commented Nov 27, 2016

Move lists of source files into their own directory
Make scons use the lists of source files
Move lua build step to src/SConscript and delete src/lua/SConscript
Make cmake use the separate file with the list of lua sources to build

@CelticMinstrel @GregoryLundberg @gfgtdf This is essentially a re-submission of #879 due to me screwing stuff up enough with git while trying to fix something that I decided to just try deleting all the commits, and then resubmitting them. Unfortunately, a PR with no commits is automatically closed, so I renamed the branch to something more fitting, and made this PR.

@gfgtdf
Copy link
Contributor

gfgtdf commented Nov 28, 2016

Unfortunately, a PR with no commits is automatically closed

I think you can reopen prs? By opening a new pr you somwhow 'hide' all previous discussionon on it.

@Pentarctagon
Copy link
Member Author

I looked, but I couldn't find any sort of "re-open PR" button, and pushing the above commit to the branch did not show up in the old PR nor did it re-open it. I did link to the previous PR though, so the discussion isn't exactly hidden.

@Pentarctagon
Copy link
Member Author

Is the file gui/widgets/debug.cpp still used? It is compiled by cmake as part of wesnoth-gui_widget_SRC, but apparently not by scons.

@GregoryLundberg
Copy link
Contributor

My checks from a month or two ago showed gui/widget/debug.cpp was not referenced. I never noticed it was compiled by CMake.

@CelticMinstrel
Copy link
Member

It seems like something you'd only want in a special debug build. Even if you compiled it, it wouldn't have any effect without the appropriate -D.

@Pentarctagon
Copy link
Member Author

So should I keep it as part of the build, or remove it?

@Pentarctagon
Copy link
Member Author

Pentarctagon commented Dec 3, 2016

I have left gui/widget/debug.cpp in the build lists, so now both scons and cmake will build it.

The tools I haven't tried building, since it seems they have their own issues right now as per #874, but copy/pasting:

source_lists
src/SConscript
src/CMakeLists.txt

into an otherwise unmodified and up-to-date local repository results in a successful compilation for both cmake and scons. This branch itself won't compile though, due to a recent change which, among other things, renamed src/sdl/color.cpp and src/sdl/color.hpp to src/color.cpp and src/color.hpp

@GregoryLundberg
Copy link
Contributor

Feel free to ignore my PR. If yours causes a merge conflict on any of mine, I'll fix 'em.

The issues are that that either they fail to link or too much dead code is needed to get them to link.

@Pentarctagon
Copy link
Member Author

Pentarctagon commented Dec 3, 2016

@GregoryLundberg Yeah, git is already reporting this as causing a merge conflict with src/CMakeLists.txt and src/SConscript, but that was kind of inevitable. I would have actually just taken your changes to what source files get built and merged them into my changes, since that isn't overly difficult and I would have been able to test building the tools, but your PR also made C++ changes as well, so just changing the lists of source files for the targets wouldn't have helped a whole lot (I don't think).

@Pentarctagon
Copy link
Member Author

So, unless anyone else sees any issues/has any suggestions, I don't have anything else to add to this PR.

@Pentarctagon Pentarctagon changed the title Use separate files to build scons and to build lua for cmake Have cmake and scons use same lists of source files Dec 9, 2016
@@ -6,42 +6,42 @@ from glob import glob

Import("*")

#
# load list of sources from the file in scons/sources/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is inaccurate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, that where it was when I first submitted this and it was just for scons. Will fix.

test = test_env.WesnothProgram("test", test_sources + [libwesnoth_extras, libwesnoth_core, libwesnoth, libwesnoth_sdl, libwesnoth_extras], have_test_prereqs)
#---end valid scons targets---#

#---start invalid scons targets---#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "invalid" here...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the root SConstruct, the default_target variable is specified as only accepting the values wesnoth wesnothd campaignd cutter exploder test.

@CelticMinstrel
Copy link
Member

So, I think this is a good idea and should be merged, but the conflicts need to be resolved. Presumably that's not too difficult to do? (Most likely they're from added/removed/moved files since the PR was opened.)

@GregoryLundberg
Copy link
Contributor

hold off until I fix my PR it's looking like this and @Vultraz latest in this area will render it moot but there may be a tweak or two needed here

@Pentarctagon
Copy link
Member Author

Pentarctagon commented Dec 11, 2016

@CelticMinstrel The conflicts are, I believe, that the lists of source files in src/SConscript and src/CMakeLists.txt have changed since I submitted this PR. I've been keeping this PR up-to-date with those changes though, and squashing those updates together which is why the "Finish changing over to source lists" commit keeps moving, so everything should be in order.

@Pentarctagon
Copy link
Member Author

@CelticMinstrel Also, I suppose I should add, I have no idea how to resolve merge conflicts with git. I think it's supposed to involve git mergetool, but that keeps telling me that "No files need merging".

@Vultraz
Copy link
Member

Vultraz commented Dec 11, 2016

One needs to rebase the branch. You resolve conflicts while doing that. However, GitHub now has a Resolve Conflicts button.

@CelticMinstrel
Copy link
Member

CelticMinstrel commented Dec 11, 2016

Just to be sure, there have been no CMake/scons changes since this PR was submitted, right? Other than the source lists.

If that's the case, then resolving the conflicts means simply ignoring the changes on the master side of the merge.

Move lists of source files into their own directory
Make scons use the lists of source files
Move lua build step to src/SConscript and delete src/lua/SConscript
Make cmake use the separate file with the list of lua sources to build
scons
  move source files from libraries that don't appear in cmake over to existing source lists - libcampaignd, libcutter, libdummy_video, libtest_utils
  add the defines FIFODIR and WESNOTH_PATH to all compiled source files, as cmake does, and move the single files those defines had previously been defined on into the source lists
  remove WESNOTH_PREFIX, as not used
  added schema_validator sources from cmake
  added OBJPREFIX to - cutter, exploder, campaignd, schema_generator, schema_validator
cmake
  change over to using the source lists
  move source files from libraries that don't appear in scons over to existing source lists - wesnoth-gui_types, wesnoth-gui_event, wesnoth-gui_iterator, wesnoth-gui_placer, wesnoth-gui_tooltip, wesnoth-gui_widget, wesnoth-gui_widget_definition, wesnoth-gui1_widgets, wesnoth-schema_validator
@Pentarctagon
Copy link
Member Author

Pentarctagon commented Dec 11, 2016

Alright, I'm going to double-check a few things, but I think I managed to do a rebase without horribly breaking the PR this time.

@CelticMinstrel With the exception of this one, yes. Though in that case I had already removed scons' libdummy_video library to bring it in sync with cmake, and the only other change was the actual removal of dummy_video.cpp.

@CelticMinstrel
Copy link
Member

Okay, just waiting to see what @GregoryLundberg has to say, I guess.

@CelticMinstrel CelticMinstrel merged commit 5b29805 into wesnoth:master Dec 15, 2016
@Pentarctagon Pentarctagon deleted the scons-cmake-source-lists branch December 16, 2016 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants