-
-
Notifications
You must be signed in to change notification settings - Fork 665
Update CMakeLists.txt mainly for MSVC #344
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
Conversation
@underdoeg , @Acclution if either of you is still testing the cmake build, can you comment if this works properly? |
I still rely on cmake when using gdnative on linux. on first glance this looks ok. but I dont have the time right now to actually test it. but if it were up to me, feel free to merge and I would issue a new pull request with fixes for linux if necessary. |
I am at work now with a windows pc and it built a lib file correctly. Though can not test against any game code. CMake generated godot-cpp.lib file (I guess it will be libgodot-cpp.a/so on linux) instead of "godot.os.build_type.system_bits". I do not remeber what the scons file name is. You can deside if this is ok. Was there a reason for removing /MD and /O2 flag? I have not tested mush agains windows myself so I have no idea if it is needed. Does the scons version have the MD or O2 flag? |
I Think CMake will choose proper option depending on a build type like /MD or /MDd and /O2. We don't need explicit definition of such options. If we do need override default ones, we need to set variables such as CMAKE_CXX_FLAGS_. On my PC, CMake set these variables as follows.
Also, Visual studio generators generates a solution file includes all build type. Matching with CMAKE_BUILD_TYPE will not work with such generators. |
I don't use CMake so I'll give to you people to sort this one out. It needs a rebase to fix the conflicts. |
Is this still relevant for Godot 4.x and GDExtension? If so, it needs a rebase before it can be considered. |
this is still relevant. I've created issue, that describes at least one problem, mentioned here |
Everything in this PR, except the option to generate the binding files from an executable, is now redundant from other PR's |
With this CMakeLists.txt, godot-cpp repository should be used as a part of user code project, and the user code should be linked with a cmake target ''godot-cpp''.
See sample use case: https://github.com/yosagi/godot-cpp-cmake
My environment:
VC2017
VC2019
CMake 3.14.5