rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
698 stars 342 forks source link

Use CMAKE_SYSTEM_PROCESSOR #1182

Closed undisputed-seraphim closed 1 year ago

undisputed-seraphim commented 1 year ago

cmake: Use CMAKE_SYSTEM_PROCESSOR as a cross-compilation-compatible way to detect target architecture. Current cmake code breaks when trying to do cross-compilation.

(Not even sure if it is necessary, I grepped the code and no file uses the __x86_64__ define, and one commented-out line uses the IS_X86_64 cmake variable. I secondarily propose that we remove it completely)

UPDATE: Check for x86 has been removed.

cielavenir commented 1 year ago

Actually even it is not required

In my hobby project there is a variable like this. This works without config, which means they are defined by compiler itself.

        const char *version_info_arch=
#if defined(__x86_64__)
        #if defined(__ILP32__)
                "x32"
        #else
                "amd64"
        #endif
#elif defined(__i386__)
        "i386"
#elif defined(__aarch64__)
        "arm64"
#elif defined(__arm__)
        "arm"
#elif defined(__sparc__)
        "sparc"
#else
        "other"
#endif
        ;
undisputed-seraphim commented 1 year ago

Yeah I think I will add a commit to remove it completely instead.

rdiankov commented 1 year ago

thanks