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

Setting FLOAT_PRECISION properly #55

Open
BrianWiz opened this issue Jun 13, 2023 · 2 comments
Open

Setting FLOAT_PRECISION properly #55

BrianWiz opened this issue Jun 13, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@BrianWiz
Copy link

BrianWiz commented Jun 13, 2023

I'm new to CMake so I'm not entirely sure if this is the best solution, I was running into issues with real_t not being set correctly on my project.

I fixed it by putting this in the main CMakeLists.txt and then using the following env when using cmake -B:
-DFLOAT_PRECISION=double

if ("${FLOAT_PRECISION}" STREQUAL "double")
	add_definitions(-DREAL_T_IS_DOUBLE)
endif()

Thanks so much for this project, it's been massively helpful.

@asmaloney
Copy link
Owner

Thanks Brian! Good catch - I've never used the doubles version of Godot, so it hadn't occurred to me.

I'll take a look and add something for this in my next release.

@asmaloney asmaloney added the enhancement New feature or request label Jun 13, 2023
@asmaloney asmaloney self-assigned this Jun 13, 2023
@asmaloney
Copy link
Owner

I submitted a fix to godot-cpp to resolve this.

godotengine/godot-cpp#1145

The correct solution is to add the define to the godot-cpp target using public target_compile_definitions. Then when that target is used, the define will come along for the ride...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants