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

cmake platform autodetect #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tansy
Copy link

@tansy tansy commented Sep 25, 2023

There is somewhat confusing construction of configuration in CMakeLists.txt that will automatically run 64-bit configuration on 32-bit system.

Initial BUILD_X64=ON
Initial CMAKE_BUILD_TYPE=
rdopng build type: Release
Building 64-bit
-- Configuring done

Even if someone makes that effort co cross compile to x64 on x86 they will not run it anyway. Opposite situation - cross compiling and running 32-bit program on 64-bit system - is absolutely possible. It would be better to set 32-bit build false by default and auto detect platform.

# on 32-bit system
Initial BUILD_X32=OFF
(...)
Building 32-bit
# on 64-bit system
Initial BUILD_X32=OFF
(...)
Building 64-bit

If one wanted to force 32-bit compilation they can do that with $ cmake -DBUILD_X32 ..

# on 64-bit system
Initial BUILD_X32=TRUE
(...)
Building 32-bit

@tansy tansy force-pushed the platform-autodetect-1 branch from ef685b7 to 70e7362 Compare September 25, 2023 14:39
@richgel999
Copy link
Owner

Thanks! I suck at cmake. Will test this and integrate the next time I spend a few days working on this project.

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.

2 participants