Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Utils
KWSys
Commits
24af80b1
Commit
24af80b1
authored
17 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Added CPU.h to KWSys to identify the target CPU and its byte order.
parent
7d15ea23
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+4
-1
4 additions, 1 deletion
CMakeLists.txt
CPU.h.in
+111
-0
111 additions, 0 deletions
CPU.h.in
kwsysDateStamp.cmake
+1
-1
1 addition, 1 deletion
kwsysDateStamp.cmake
with
116 additions
and
2 deletions
CMakeLists.txt
+
4
−
1
View file @
24af80b1
...
...
@@ -138,6 +138,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET
(
KWSYS_USE_DateStamp 1
)
SET
(
KWSYS_USE_String 1
)
SET
(
KWSYS_USE_SystemInformation 1
)
SET
(
KWSYS_USE_CPU 1
)
ENDIF
(
KWSYS_STANDALONE OR CMake_SOURCE_DIR
)
# Setup the large file support default.
...
...
@@ -651,7 +652,9 @@ FOREACH(cpp ${cppclasses})
ENDFOREACH
(
cpp
)
# Add selected C components.
FOREACH
(
c Process Base64 FundamentalType MD5 Terminal System DateStamp String
)
FOREACH
(
c
Process Base64 FundamentalType MD5 Terminal System DateStamp String CPU
)
IF
(
KWSYS_USE_
${
c
}
)
# Use the corresponding header file.
SET
(
KWSYS_H_FILES
${
KWSYS_H_FILES
}
${
c
}
)
...
...
This diff is collapsed.
Click to expand it.
CPU.h.in
0 → 100644
+
111
−
0
View file @
24af80b1
/*=========================================================================
Program: KWSys - Kitware System Library
Module: CPU.h.in
Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef @KWSYS_NAMESPACE@_CPU_h
#define @KWSYS_NAMESPACE@_CPU_h
#include <@KWSYS_NAMESPACE@/Configure.h>
/* Identify possible endian cases. The macro
@KWSYS_NAMESPACE@_CPU_ENDIAN_ID will be defined to one of these, or
0 if unknown. */
#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG 4321
#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE 1234
/* Apple always defines one of these. */
#if defined(__LITTLE_ENDIAN__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__BIG_ENDIAN__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* Alpha */
#elif defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE__
/* Intel x86 */
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__MWERKS__) && defined(__INTEL__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
/* Intel x86-64 */
#elif defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__amd64) || defined(__amd64__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
/* Intel Architecture-64 (Itanium) */
#elif defined(__ia64) || defined(__ia64__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(_IA64) || defined(__IA64__) || defined(_M_IA64)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
/* PowerPC */
#elif defined(__powerpc) || defined(__powerpc__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
#elif defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* SPARC */
#elif defined(__sparc) || defined(__sparc__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* HP/PA RISC */
#elif defined(__hppa) || defined(__hppa__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* Motorola 68k */
#elif defined(__m68k__) || defined(M68000)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* MIPS */
#elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* RS/6000 */
#elif defined(__THW_RS600) || defined(_IBMR2) || defined(_POWER)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
#elif defined(_ARCH_PWR) || defined(_ARCH_PWR2)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* System/370 */
#elif defined(__370__) || defined(__THW_370__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* System/390 */
#elif defined(__s390__) || defined(__s390x__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* z/Architecture */
#elif defined(__SYSC_ZARCH__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
/* Unknown CPU */
#else
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID 0
# if !defined(@KWSYS_NAMESPACE@_CPU_UNKNOWN_OKAY)
# error "The target CPU architecture is not known."
# endif
#endif
/* If building a C or C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
# define KWSYS_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID
# define KWSYS_CPU_ENDIAN_ID_BIG @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
# define KWSYS_CPU_ENDIAN_ID_LITTLE @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#endif
#endif
This diff is collapsed.
Click to expand it.
kwsysDateStamp.cmake
+
1
−
1
View file @
24af80b1
...
...
@@ -7,4 +7,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2008)
SET
(
KWSYS_DATE_STAMP_MONTH 02
)
# KWSys version date day component. Format is DD.
SET
(
KWSYS_DATE_STAMP_DAY
19
)
SET
(
KWSYS_DATE_STAMP_DAY
27
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment