cmake: detection of the targer architecture bit size
This commit is contained in:
parent
819aec00d4
commit
d7a4e3b1b6
@ -34,6 +34,8 @@ option(BUILD_WITH_LIBSTL "Build the libSTL module" ON)
|
|||||||
file(GLOB ALL_SRC_FILES src/gmio_core/* src/gmio_core/internal/*)
|
file(GLOB ALL_SRC_FILES src/gmio_core/* src/gmio_core/internal/*)
|
||||||
set(ALL_SRC_FILES ${ALL_SRC_FILES})
|
set(ALL_SRC_FILES ${ALL_SRC_FILES})
|
||||||
|
|
||||||
|
math(EXPR GMIO_TARGET_ARCH_BIT_SIZE "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
|
|
||||||
if(NOT BUILD_STRICT_C90)
|
if(NOT BUILD_STRICT_C90)
|
||||||
# Have <stdint.h> ?
|
# Have <stdint.h> ?
|
||||||
check_include_files(stdint.h GMIO_HAVE_STDINT_H)
|
check_include_files(stdint.h GMIO_HAVE_STDINT_H)
|
||||||
|
@ -29,4 +29,16 @@
|
|||||||
|
|
||||||
#cmakedefine GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC
|
#cmakedefine GMIO_HAVE_MSVC_BUILTIN_BSWAP_FUNC
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
# if defined(__i386__) || defined(__ppc__)
|
||||||
|
# define GMIO_TARGET_ARCH_BIT_SIZE 32
|
||||||
|
# elif defined(__x86_64__) || defined(__ppc64__)
|
||||||
|
# define GMIO_TARGET_ARCH_BIT_SIZE 64
|
||||||
|
# else
|
||||||
|
# error "Unknown architecture!"
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define GMIO_TARGET_ARCH_BIT_SIZE @GMIO_TARGET_ARCH_BIT_SIZE@
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* GMIO_CONFIG_H_CMAKE */
|
#endif /* GMIO_CONFIG_H_CMAKE */
|
||||||
|
Loading…
Reference in New Issue
Block a user