godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.76k stars 3.06k forks source link

Better Scons file for GDNative C++ Documentation #3754

Open zeroxoneafour opened 4 years ago

zeroxoneafour commented 4 years ago

In this page, the Scons file is very limited in capability. It cannot compile with custom architectures or MinGW. Here is a better Scons file, tested by me with MinGW on Windows. Inspired by this issue.

SConstruct.zip

ryanpeach commented 3 years ago

I also feel like the one provided should be able to auto detect platforms.

Calinou commented 3 years ago

@ryanpeach The SCons file from the documentation should probably be removed at this point. It would be better moved to the godot-cpp repository.

philomelus commented 2 years ago

I had to add the following

env.Tool('mingw')

below

if env['use_mingw']:

to the above SConstruct and it worked. Before adding the env.Tool line, it would generate a mixture of msvc and mingw commands (e.g. 'g++ /Fosrc/example.o ... instead of g++ -o src/example.o ...).