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

Replace SCons build system with <insert favorite build system here> #81

Closed
kd7tck opened this issue Feb 15, 2014 · 36 comments
Closed

Replace SCons build system with <insert favorite build system here> #81

kd7tck opened this issue Feb 15, 2014 · 36 comments

Comments

@kd7tck
Copy link

kd7tck commented Feb 15, 2014

My experience with scons so far is not good. Out of date and incompatible with newer versions of compilers. Work-around is painstaking to set up and requires that I manually set up the SConstruct file for my system. This of course can not be patched back since it is for my system alone. I want to start work on a cmake build system, anyone else interested post here.

@marynate
Copy link
Contributor

Personally I'm fine with SConstruct, it works perfectly for me on my Mac/Win setup. But I do agree with you, CMake would be a great addition since it's much better maintained.

@reduz
Copy link
Member

reduz commented Feb 15, 2014

See issue #15 #15
Build system is way too complex and migrating it at this point would take
weeks. Also, I don't like CMake, If I were to switch, I'd rather use a
build system with a real scripting language.

On Sat, Feb 15, 2014 at 12:37 AM, marynate notifications@github.com wrote:

Personally I'm fine with SConstruct, it works perfectly for me on my
Mac/Win setup. But I do agree with you, CMake would be a great addition
since it's much better maintained.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35146411
.

@punto-
Copy link
Contributor

punto- commented Feb 15, 2014

Can you provide details of what doesn't work for you?

On Sat, Feb 15, 2014 at 12:33 AM, Joshua Reisenauer <
notifications@github.com> wrote:

My experience with scons so far is not good. Out of date and incompatible
with newer versions of compilers. Work-around is painstaking to set up and
requires that I manually set up the SConstruct file for my system. This of
course can not be patched back since it is for my system alone. I want to
start work on a cmake build system, anyone else interested post here.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81
.

@kd7tck
Copy link
Author

kd7tck commented Feb 15, 2014

Perhaps the tutorial for scons compilation, on the wiki, is just not thorough. If this is truly the case, I welcome anyone to show me how to correctly compile using scons in windows.

I installed python 2.7 32bit, then scons 2.3. I set the environment variables and aliases for windows up. Then I did as the instructions said and ran "scons.bat bin/godot.exe" from the godot directory in C. No luck, it is not compatible with newer versions of visual studio. It could not find my VS 12 install and I had no interest in installing multiple copies of VS on my system. If you know how to get scons to recognize VS 12 then please post how to do this.

So then I did a work around with mingw. It worked like a charm after I manually modified the build file to include the correct directories for lib and header files. I should not have to do this with a build system. It should just work. If you use scons then at least include a find routine in the build system for finding the dependencies in mingw. I unfortunately do not know scons well enough to write such a routine. I deal in cmake and C mainly. Personally I don't mind using mingw, I prefer it actually. I just should not be forced to modify the build file to get it to work.

If anyone has any suggestions for making this process easier on windows then please post it in the godot wiki where it may be of use. Otherwise I will just go ahead with my own cmake write up. It will take a while, but will be worth it for more up to date windows systems.

@punto-
Copy link
Contributor

punto- commented Feb 15, 2014

So this is Visual Studio 13? Can you find out the version of the compiler
and linker? Run "cl" and "link" on the visual studio command prompt.

On Sat, Feb 15, 2014 at 2:10 AM, Joshua Reisenauer <notifications@github.com

wrote:

Perhaps the tutorial for scons compilation, on the wiki, is just not
thorough. If this is truly the case, I welcome anyone to show me how to
correctly compile using scons in windows.

I installed python 2.7 32bit, then scons 2.3. I set the environment
variables and aliases for windows up. Then I did as the instructions said
and ran <> from the godot directory in C. No luck, it is not compatible
with newer versions of visual studio. It could not find my VS 12 install
and I had no interest in installing multiple copies of VS on my system. If
you know how to get scons to recognize VS 12 then please post how to do
this.

So then I did a work around with mingw. It worked like a charm after I
manually modified the build file to include the correct directories for lib
and header files. I should not have to do this with a build system. It
should just work. If you use scons then at least include a find routine in
the build system for finding the dependencies in mingw. I unfortunately do
not know scons well enough to write such a routine. I deal in cmake and C
mainly. Personally I don't mind using mingw, I prefer it actually. I just
should not be forced to modify the build file to get it to work.

If anyone has any suggestions for making this process easier on windows
then please post it in the godot wiki where it may be of use. Otherwise I
will just go ahead with my own cmake write up. It will take a while, but
will be worth it for more up to date windows systems.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35147759
.

@kd7tck
Copy link
Author

kd7tck commented Feb 15, 2014

No it is VS 12. The version is currently one number behind the year.

cl is version 18
link is version 12

@marynate
Copy link
Contributor

I tested building with VS2010 and VS2013, both fine.

Have you run scons in Visual Studio command prompt?

@punto-
Copy link
Contributor

punto- commented Feb 15, 2014

Thanks. Can you take a screenshot of the error you get when you try to
build?

On Sat, Feb 15, 2014 at 3:25 AM, Joshua Reisenauer <notifications@github.com

wrote:

No it is VS 12. The version is currently one number behind the year.

cl is version 18
link is version 12

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35148714
.

@kd7tck
Copy link
Author

kd7tck commented Feb 15, 2014

https://www.dropbox.com/s/z7gh87x1xshkw3h/Screenshot%202014-02-15%2001.17.11.png
https://www.dropbox.com/s/avg02kea1li8cc3/Screenshot%202014-02-15%2001.16.50.png

I followed the directions from http://www.godotengine.org/wiki/doku.php?id=compiling_windows. I first went into the command prompt from within VS then went into godot root. Then "scons bin/godot.exe" this returned the error from above picture. then I tried the batch file build mentioned at bottom of tutorial. I made the batch file and ran it from within visual studio, nothing.

Maybe you could post you're visual studio 2013 settings into an exported file. I could import that and look for any inconsistencies in my set up. Maybe it is just a matter of one setting being off within VS.

@reduz
Copy link
Member

reduz commented Feb 15, 2014

You have to run from visual studio command prompt, I'll add a screenshot to
the wiki so that step is clearer

On Sat, Feb 15, 2014 at 6:28 AM, Joshua Reisenauer <notifications@github.com

wrote:

https://www.dropbox.com/s/z7gh87x1xshkw3h/Screenshot%202014-02-15%2001.17.11.png

https://www.dropbox.com/s/avg02kea1li8cc3/Screenshot%202014-02-15%2001.16.50.png

I followed the directions from
http://www.godotengine.org/wiki/doku.php?id=compiling_windows. I first
went into the command prompt from within VS then went into godot root. Then
"scons bin/godot.exe" this returned the error from above picture. then I
tried the batch file build mentioned at bottom of tutorial. I made the
batch file and ran it from within visual studio, nothing.

Maybe you could post you visual studio 2013 settings into an exported
file. I could import that and look for any inconsistencies in my set up.
Maybe it is just a matter of one setting being off within VS.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35151448
.

@TiZ-HugLife
Copy link
Contributor

If we're going to change build systems, I'd rather it be to waf than to cmake. And @caitp seems to be working on that now, so let's wait to see how that goes.

@reduz
Copy link
Member

reduz commented Feb 15, 2014

how compatible is waf with scons?

On Sat, Feb 15, 2014 at 2:53 PM, TiZ-EX1 notifications@github.com wrote:

If we're going to change build systems, I'd rather it be to waf than to
cmake.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35162546
.

@TiZ-HugLife
Copy link
Contributor

As caitp said in the issue you referenced, one is a fork of the other. I've never had problems building godot with scons, but waf is really slick. So if the migration to waf works out, I'm behind it, otherwise, I don't see a reason to change right now.

@larryweya
Copy link

SCons works great for me os OSX but personally I second the opinion to have CMake only because I'd like to be able to generate XCode projects as I'm as IDE man. Any suggestions on how to generate XCode project files with SCons as the build system?

@kd7tck
Copy link
Author

kd7tck commented Feb 15, 2014

@reduz
I did run it from VS command prompt. The tools folder for VS right.
There must be some other step that is not being done. I hate learning new build systems, there is nothing more aggravating.

@punto-
Copy link
Contributor

punto- commented Feb 16, 2014

Are you able to run "cl" and "link" from that same command prompt?

there is nothing more aggravating.

You obviously haven't dealt with iOS signing/certificates/provisioning :p

On Sat, Feb 15, 2014 at 9:55 PM, Joshua Reisenauer <notifications@github.com

wrote:

@reduz https://github.com/reduz
I did run it from VS command prompt. The tools folder for VS right.
There must be some other step that is not being done. I hate learning new
build systems, there is nothing more aggravating.

Reply to this email directly or view it on GitHubhttps://github.com//issues/81#issuecomment-35171965
.

@kd7tck
Copy link
Author

kd7tck commented Feb 16, 2014

I got it to work. I removed all posix environment folders from my $PATH. I did not know scons was posix, that definitely changes how I will use it from now on. It seems the default windows build is mingw and only when it does not find it, will it go over to VS.

@PUNTO : You are right mobile development is the hardest

@Kisaiyuki
Copy link

re: getting VS to work.
Visual C++ 2010 (Express):
After installing Windows SDK 7.1, select the "Windows SDK 7.1 Command Prompt"
type:
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\

That will get it past the initial problem of not being able to find Visual Studio (I also have mingw32 installed, and it will default to mingw32 if the environment variable is not found)
VSINSTALLDIR is not set by the Windows SDK 7.1 Command prompt, but is set by the vcsetvars32.bat (which is run when you select the command line for your Visual Studio version)

The next problem comes up if you have an x64 system, as the build will default to x64 using the 7.1 SDK.
You can either do:
setenv.cmd /x86
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0
And it should work fine
or you can actually fix the one file that blocks x64 from building
open up math_funcs.h
go to

#if defined(_MSC_VER) && _MSC_VER < 1800

and change this to

#if defined(_MSC_VER) && _MSC_VER < 1800 && !_WIN64

The inline assembly __asm's do not work when compiling for a x64 target
Now it will complain about lrintf() missing under VS2010 (and likely all versions prior and including 2012, this C99 function only appears in VS2013) The other option is to obviously just create 64bit assembly as the VS compiler would expect it, but this is getting beyond the problem.

The other thing that needs to change for it (assuming fixing the lrint function) is the library path
For that, I simply changed the libpaths to this in platform/windows/detect.py :

    if(os.getenv("TARGET_CPU")=="x86"):
        env.Append(LIBPATH=[os.getenv("WindowsSdkDir")+"/Lib"])
        env.Append(LIBPATH=[VC_PATH+"/Lib"])
        env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"])
    elif(os.getenv("TARGET_CPU")=="x64"):
        env.Append(LIBPATH=[os.getenv("WindowsSdkDir")+"/Lib/x64"])
        env.Append(LIBPATH=[VC_PATH+"/Lib/amd64"])
        env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x64"])

Again, this is assuming the Windows SDK 7.1
With VS2013 and/or Windows SDK 8.1 the above works for 64bit builds.

@ericwomer
Copy link

Please let it be CMake that wins out and not sticking with scons or WAF, what ever that is, since I can only think of one obscure project that even uses it. Use something that more people would know how to use like cmake, I would rather have anything other then WAF, even the old auto-tools or even stick with SCons.

@ericwomer
Copy link

@reduz how many projects do you know that use WAF compared to projects that use CMake?

@TiZ-HugLife
Copy link
Contributor

Waf, obscure? That's cute. Autotools better than Waf? Now you're just being offensive. Here you go: https://code.google.com/p/waf/wiki/ProjectsUsingWaf

@samsaga2
Copy link
Contributor

If something is working don't change it! It is more important to improve the quality of current system than make a new one. SCons is beyond from perfect, but it works.

My 5 cents:

  • Some functions has more than 300 lines.
  • The are blank lines without reason.
  • Lines beyond 200 characters.
  • File methods.py needs to be splitted.
  • String templates needs to be moved to files for readability (shaders, c headers, ...).
  • Please, move the build code to a new folder (now it is on project root).

This is only for the build scripts but it can be applied to all the code (EditorNode constructor has more than 900 lines!).

@rraallvv
Copy link
Contributor

What about waf (https://code.google.com/p/waf/)

I stumbled with an article saying that waf is built from SCons but much better

Source: http://undefinedvalue.com/2008/02/19/good-bye-scons-hello-cmake

@reduz
Copy link
Member

reduz commented Dec 16, 2014

didn't realize this issue was still open. The build system was rewritten from scratch and cleaned up some months ago. It still uses SCons but it works great now.

@reduz reduz closed this as completed Dec 16, 2014
@JonathonReinhart
Copy link

This issue shows up as the number 4 result in a Google search for "scons visual studio". @reduz Would you mind directing future visitors to the details of the build system rewrite? Any relevant issues or pull requests? Thanks.

@reduz
Copy link
Member

reduz commented Dec 20, 2015

There already was a build system rewrite a year or so ago, but it was a
mostly cleaning up.
Scons is the best build system one can find for a project the size of
Godot, and it can also export visual studio project files already.

On Sun, Dec 20, 2015 at 5:34 AM, Jonathon Reinhart <notifications@github.com

wrote:

This issue shows up as the number 4 result in a Google search for "scons
visual studio" https://www.google.com/search?q=scons%20visual%20studio.
@reduz https://github.com/reduz Would you mind directing future
visitors to the details of the build system rewrite? Any relevant issues or
pull requests? Thanks.


Reply to this email directly or view it on GitHub
#81 (comment).

@ghost
Copy link

ghost commented Jul 1, 2016

Would be awesome to integrate Hunter+Polly

https://github.com/ruslo/hunter
https://github.com/ruslo/polly

It has several packages already prepared: https://github.com/hunter-packages

@akien-mga
Copy link
Member

Won't happen, as per the reasons given above. There is no buildsystem other than SCons (or maybe SCons-derived buildsystems like waf) that would have enough flexibility for the complexity of Godot's environment.

@punto-
Copy link
Contributor

punto- commented Jul 1, 2016

what if we somehow got the scons/python prople to give us a package that could run scons from a single binary on windows? Like a "scons.exe" that does everything. I think that's the main problem for us

@akien-mga
Copy link
Member

I don't see it as a big problem; setting up a build environment on Windows is a pain anyway, so having to install Python and SCons does not seem too demanding to me after you've setup MSVC or MinGW.
On other OSes, installing scons takes half a second :)

@dirkbaechle
Copy link

One of the SCons devs here...if you have a real need for something like this, there is the self-contained "scons-local" package available. In addition, we have now (2.5.0+) fixed our PyPi setup, so a user should be able to simply call "pip install scons" under Python 2.7.
If you need something even simpler than that, please come over to our mailing list at scons-users@scons.org ( see http://scons.org/lists.html ) and let's discuss things.

@akien-mga akien-mga changed the title Scons is terrible build system. Add second build system cmake. Replace SCons build system with <insert favorite build system here> Aug 15, 2016
@ghost
Copy link

ghost commented May 7, 2017

If not totally replacing SCons with CMake, at least make both available.
CMake just require 2 clicks to set up a project on whatever IDE.

@reduz
Copy link
Member

reduz commented May 7, 2017

Sorry, Godot build process is way too complex for CMake. Not happening.

@blockspacer
Copy link

@reduz
conan can solve that issue. Godot will use scons, but CMake-based (not only CMake) projects will be able to import Godot modules with proper defines, link flags e.t.c.
Please look at #37180

@SC-One
Copy link

SC-One commented Sep 18, 2021

Sorry, Godot build process is way too complex for CMake. Not happening.

Every projects can be handled by CMake ...
SCons in godot make us(me and my friends that like to work with godot) sad , because maintaining modules is so hard ,
and many IDEs can work easy with cmake(and important note: making project hirarchy in IDE is easy when project handled by cmake ... cause of that so many IDEs can work better with cmake) .
if it need weeks to change it , it's better to start now , not when all users leaving godot just cause of Build Systme !
I just know compiling godot with scons was so nice and easy , but maintaining modules with that was so hard for me , cause of that I always spend my time just for finding something in scons (sometime I can't find my final answer ...)
I really like godot , and wanna work more on that , but when I cant have good code model in IDE and good access to files in hirarchy file , I be tired soon.
Please start a branch for CMake and maybe professional guys could help ...

@Zireael07
Copy link
Contributor

@SC-One: Currently Meson is being looked at #52311

Reduz said above that he wants a scripting language capable build system, which CMake isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests