Port CMake from cmIML to KWIML
KWIML no longer uses a configured prefix.
This commit is contained in:
parent
12293371ee
commit
036b6ef7c4
|
@ -538,9 +538,9 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
|
||||||
set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
|
set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create the KWIML library for CMake.
|
if(BUILD_TESTING)
|
||||||
set(KWIML cmIML)
|
set(KWIML_TEST_ENABLE 1)
|
||||||
set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
|
endif()
|
||||||
add_subdirectory(Utilities/KWIML)
|
add_subdirectory(Utilities/KWIML)
|
||||||
|
|
||||||
if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
||||||
|
|
|
@ -36,7 +36,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
"LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF"
|
"LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF"
|
||||||
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
|
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
|
||||||
"LINK : warning LNK4089: all references to.*ole32.dll.*discarded by /OPT:REF"
|
"LINK : warning LNK4089: all references to.*ole32.dll.*discarded by /OPT:REF"
|
||||||
"Warning.*: .*/Utilities/KWIML/test/test_INT_format.h.* # Redundant preprocessing concatenation"
|
"Warning.*: .*/Utilities/KWIML/test/test_int_format.h.* # Redundant preprocessing concatenation"
|
||||||
"Warning: library was too large for page size.*"
|
"Warning: library was too large for page size.*"
|
||||||
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
|
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
|
||||||
"Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"
|
"Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"
|
||||||
|
|
|
@ -162,13 +162,13 @@ struct cmRange
|
||||||
const_iterator end() const { return End; }
|
const_iterator end() const { return End; }
|
||||||
bool empty() const { return std::distance(Begin, End) == 0; }
|
bool empty() const { return std::distance(Begin, End) == 0; }
|
||||||
difference_type size() const { return std::distance(Begin, End); }
|
difference_type size() const { return std::distance(Begin, End); }
|
||||||
cmRange& advance(cmIML_INT_intptr_t amount)
|
cmRange& advance(KWIML_INT_intptr_t amount)
|
||||||
{
|
{
|
||||||
std::advance(Begin, amount);
|
std::advance(Begin, amount);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmRange& retreat(cmIML_INT_intptr_t amount)
|
cmRange& retreat(KWIML_INT_intptr_t amount)
|
||||||
{
|
{
|
||||||
std::advance(End, -amount);
|
std::advance(End, -amount);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -15,9 +15,6 @@
|
||||||
#include <cmsys/auto_ptr.hxx>
|
#include <cmsys/auto_ptr.hxx>
|
||||||
#include <cmsys/FStream.hxx>
|
#include <cmsys/FStream.hxx>
|
||||||
|
|
||||||
// Need the native byte order of the running CPU.
|
|
||||||
#include <cmIML/ABI.h>
|
|
||||||
|
|
||||||
// Include the ELF format information system header.
|
// Include the ELF format information system header.
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
|
@ -101,9 +98,9 @@ public:
|
||||||
// In most cases the processor-specific byte order will match that
|
// In most cases the processor-specific byte order will match that
|
||||||
// of the target execution environment. If we choose wrong here
|
// of the target execution environment. If we choose wrong here
|
||||||
// it is fixed when the header is read.
|
// it is fixed when the header is read.
|
||||||
#if cmIML_ABI_ENDIAN_ID == cmIML_ABI_ENDIAN_ID_LITTLE
|
#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE
|
||||||
this->NeedSwap = (this->ByteOrder == ByteOrderMSB);
|
this->NeedSwap = (this->ByteOrder == ByteOrderMSB);
|
||||||
#elif cmIML_ABI_ENDIAN_ID == cmIML_ABI_ENDIAN_ID_BIG
|
#elif KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_BIG
|
||||||
this->NeedSwap = (this->ByteOrder == ByteOrderLSB);
|
this->NeedSwap = (this->ByteOrder == ByteOrderLSB);
|
||||||
#else
|
#else
|
||||||
this->NeedSwap = false; // Final decision is at runtime anyway.
|
this->NeedSwap = false; // Final decision is at runtime anyway.
|
||||||
|
@ -197,7 +194,7 @@ struct cmELFTypes32
|
||||||
typedef Elf32_Shdr ELF_Shdr;
|
typedef Elf32_Shdr ELF_Shdr;
|
||||||
typedef Elf32_Dyn ELF_Dyn;
|
typedef Elf32_Dyn ELF_Dyn;
|
||||||
typedef Elf32_Half ELF_Half;
|
typedef Elf32_Half ELF_Half;
|
||||||
typedef cmIML_INT_uint32_t tagtype;
|
typedef KWIML_INT_uint32_t tagtype;
|
||||||
static const char* GetName() { return "32-bit"; }
|
static const char* GetName() { return "32-bit"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -208,7 +205,7 @@ struct cmELFTypes64
|
||||||
typedef Elf64_Shdr ELF_Shdr;
|
typedef Elf64_Shdr ELF_Shdr;
|
||||||
typedef Elf64_Dyn ELF_Dyn;
|
typedef Elf64_Dyn ELF_Dyn;
|
||||||
typedef Elf64_Half ELF_Half;
|
typedef Elf64_Half ELF_Half;
|
||||||
typedef cmIML_INT_uint64_t tagtype;
|
typedef KWIML_INT_uint64_t tagtype;
|
||||||
static const char* GetName() { return "64-bit"; }
|
static const char* GetName() { return "64-bit"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2811,8 +2811,8 @@ namespace {
|
||||||
case CURLINFO_SSL_DATA_OUT:
|
case CURLINFO_SSL_DATA_OUT:
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
int n = sprintf(buf, "[%" cmIML_INT_PRIu64 " bytes data]\n",
|
int n = sprintf(buf, "[%" KWIML_INT_PRIu64 " bytes data]\n",
|
||||||
static_cast<cmIML_INT_uint64_t>(size));
|
static_cast<KWIML_INT_uint64_t>(size));
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
vec->insert(vec->end(), buf, buf + n);
|
vec->insert(vec->end(), buf, buf + n);
|
||||||
|
|
|
@ -130,7 +130,7 @@ private:
|
||||||
unsigned int VersionFoundPatch;
|
unsigned int VersionFoundPatch;
|
||||||
unsigned int VersionFoundTweak;
|
unsigned int VersionFoundTweak;
|
||||||
unsigned int VersionFoundCount;
|
unsigned int VersionFoundCount;
|
||||||
cmIML_INT_uint64_t RequiredCMakeVersion;
|
KWIML_INT_uint64_t RequiredCMakeVersion;
|
||||||
bool Quiet;
|
bool Quiet;
|
||||||
bool Required;
|
bool Required;
|
||||||
bool UseConfigFiles;
|
bool UseConfigFiles;
|
||||||
|
|
|
@ -2980,7 +2980,7 @@ cmLocalGenerator::GetTargetDirectory(const cmGeneratorTarget*) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
|
KWIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
|
||||||
{
|
{
|
||||||
// The computed version may change until the project is fully
|
// The computed version may change until the project is fully
|
||||||
// configured.
|
// configured.
|
||||||
|
@ -3033,7 +3033,7 @@ bool cmLocalGenerator::NeedBackwardsCompatibility_2_4()
|
||||||
|
|
||||||
// Compatibility is needed if CMAKE_BACKWARDS_COMPATIBILITY is set
|
// Compatibility is needed if CMAKE_BACKWARDS_COMPATIBILITY is set
|
||||||
// equal to or lower than the given version.
|
// equal to or lower than the given version.
|
||||||
cmIML_INT_uint64_t actual_compat = this->GetBackwardsCompatibility();
|
KWIML_INT_uint64_t actual_compat = this->GetBackwardsCompatibility();
|
||||||
return (actual_compat &&
|
return (actual_compat &&
|
||||||
actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
|
actual_compat <= CMake_VERSION_ENCODE(2, 4, 255));
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,7 +267,7 @@ public:
|
||||||
*
|
*
|
||||||
* and is monotonically increasing with the CMake version.
|
* and is monotonically increasing with the CMake version.
|
||||||
*/
|
*/
|
||||||
cmIML_INT_uint64_t GetBackwardsCompatibility();
|
KWIML_INT_uint64_t GetBackwardsCompatibility();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether compatibility is set to a given version or lower.
|
* Test whether compatibility is set to a given version or lower.
|
||||||
|
@ -390,7 +390,7 @@ protected:
|
||||||
// committed.
|
// committed.
|
||||||
std::string TargetImplib;
|
std::string TargetImplib;
|
||||||
|
|
||||||
cmIML_INT_uint64_t BackwardsCompatibility;
|
KWIML_INT_uint64_t BackwardsCompatibility;
|
||||||
bool BackwardsCompatibilityFinal;
|
bool BackwardsCompatibilityFinal;
|
||||||
private:
|
private:
|
||||||
void AddSharedFlags(std::string& flags, const std::string& lang,
|
void AddSharedFlags(std::string& flags, const std::string& lang,
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Provide fixed-size integer types.
|
// Provide fixed-size integer types.
|
||||||
#include <cmIML/INT.h>
|
#include <cm_kwiml.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
|
|
||||||
/* Encode with room for up to 1000 minor releases between major releases
|
/* Encode with room for up to 1000 minor releases between major releases
|
||||||
and to encode dates until the year 10000 in the patch level. */
|
and to encode dates until the year 10000 in the patch level. */
|
||||||
#define CMake_VERSION_ENCODE__BASE cmIML_INT_UINT64_C(100000000)
|
#define CMake_VERSION_ENCODE__BASE KWIML_INT_UINT64_C(100000000)
|
||||||
#define CMake_VERSION_ENCODE(major, minor, patch) \
|
#define CMake_VERSION_ENCODE(major, minor, patch) \
|
||||||
((((major) * 1000u) * CMake_VERSION_ENCODE__BASE) + \
|
((((major) * 1000u) * CMake_VERSION_ENCODE__BASE) + \
|
||||||
(((minor) % 1000u) * CMake_VERSION_ENCODE__BASE) + \
|
(((minor) % 1000u) * CMake_VERSION_ENCODE__BASE) + \
|
||||||
|
|
|
@ -87,22 +87,21 @@
|
||||||
* made).
|
* made).
|
||||||
*/
|
*/
|
||||||
#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
|
#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
|
||||||
/* CMake modification: use byte order from cmIML. */
|
/* CMake modification: use byte order from KWIML. */
|
||||||
# include "cmIML/ABI.h"
|
|
||||||
# undef BYTE_ORDER
|
# undef BYTE_ORDER
|
||||||
# undef BIG_ENDIAN
|
# undef BIG_ENDIAN
|
||||||
# undef LITTLE_ENDIAN
|
# undef LITTLE_ENDIAN
|
||||||
# define BYTE_ORDER cmIML_ABI_ENDIAN_ID
|
# define BYTE_ORDER KWIML_ABI_ENDIAN_ID
|
||||||
# define BIG_ENDIAN cmIML_ABI_ENDIAN_ID_BIG
|
# define BIG_ENDIAN KWIML_ABI_ENDIAN_ID_BIG
|
||||||
# define LITTLE_ENDIAN cmIML_ABI_ENDIAN_ID_LITTLE
|
# define LITTLE_ENDIAN KWIML_ABI_ENDIAN_ID_LITTLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* CMake modification: use types computed in header. */
|
/* CMake modification: use types computed in header. */
|
||||||
typedef cm_sha2_uint8_t sha_byte; /* Exactly 1 byte */
|
typedef cm_sha2_uint8_t sha_byte; /* Exactly 1 byte */
|
||||||
typedef cm_sha2_uint32_t sha_word32; /* Exactly 4 bytes */
|
typedef cm_sha2_uint32_t sha_word32; /* Exactly 4 bytes */
|
||||||
typedef cm_sha2_uint64_t sha_word64; /* Exactly 8 bytes */
|
typedef cm_sha2_uint64_t sha_word64; /* Exactly 8 bytes */
|
||||||
#define SHA_UINT32_C(x) cmIML_INT_UINT32_C(x)
|
#define SHA_UINT32_C(x) KWIML_INT_UINT32_C(x)
|
||||||
#define SHA_UINT64_C(x) cmIML_INT_UINT64_C(x)
|
#define SHA_UINT64_C(x) KWIML_INT_UINT64_C(x)
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
# pragma clang diagnostic ignored "-Wcast-align"
|
# pragma clang diagnostic ignored "-Wcast-align"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,11 +38,11 @@
|
||||||
|
|
||||||
#include "cm_sha2_mangle.h"
|
#include "cm_sha2_mangle.h"
|
||||||
|
|
||||||
/* CMake modification: use integer types from cmIML. */
|
/* CMake modification: use integer types from KWIML. */
|
||||||
#include "cmIML/INT.h"
|
#include <cm_kwiml.h>
|
||||||
typedef cmIML_INT_uint8_t cm_sha2_uint8_t;
|
typedef KWIML_INT_uint8_t cm_sha2_uint8_t;
|
||||||
typedef cmIML_INT_uint32_t cm_sha2_uint32_t;
|
typedef KWIML_INT_uint32_t cm_sha2_uint32_t;
|
||||||
typedef cmIML_INT_uint64_t cm_sha2_uint64_t;
|
typedef KWIML_INT_uint64_t cm_sha2_uint64_t;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
#ifndef cm_kwiml_h
|
||||||
|
#define cm_kwiml_h
|
||||||
|
|
||||||
|
#include "KWIML/include/kwiml/abi.h"
|
||||||
|
#include "KWIML/include/kwiml/int.h"
|
||||||
|
|
||||||
|
#endif
|
19
bootstrap
19
bootstrap
|
@ -373,11 +373,6 @@ KWSYS_FILES="\
|
||||||
SystemTools.hxx \
|
SystemTools.hxx \
|
||||||
Terminal.h"
|
Terminal.h"
|
||||||
|
|
||||||
KWIML_FILES='
|
|
||||||
ABI.h
|
|
||||||
INT.h
|
|
||||||
'
|
|
||||||
|
|
||||||
# Display CMake bootstrap usage
|
# Display CMake bootstrap usage
|
||||||
cmake_usage()
|
cmake_usage()
|
||||||
{
|
{
|
||||||
|
@ -702,11 +697,6 @@ if [ ! -d "cmsys" ]; then
|
||||||
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
|
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -d "cmIML" ] || mkdir "cmIML"
|
|
||||||
if [ ! -d "cmIML" ]; then
|
|
||||||
cmake_error 12 "Cannot create directory ${cmake_bootstrap_dir}/cmIML"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete all the bootstrap files
|
# Delete all the bootstrap files
|
||||||
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
|
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
|
||||||
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
|
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
|
||||||
|
@ -1280,11 +1270,6 @@ for a in ${KWSYS_FILES}; do
|
||||||
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
|
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
|
||||||
done
|
done
|
||||||
|
|
||||||
for a in ${KWIML_FILES}; do
|
|
||||||
cmake_replace_string "${cmake_source_dir}/Utilities/KWIML/${a}.in" \
|
|
||||||
"${cmake_bootstrap_dir}/cmIML/${a}" KWIML cmIML
|
|
||||||
done
|
|
||||||
|
|
||||||
# Generate Makefile
|
# Generate Makefile
|
||||||
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
|
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
|
||||||
objs=""
|
objs=""
|
||||||
|
@ -1326,9 +1311,9 @@ cmake_cxx_flags_SystemTools="
|
||||||
-DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
|
-DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
|
||||||
"
|
"
|
||||||
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
||||||
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
|
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
|
||||||
cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
||||||
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
|
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
|
||||||
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
|
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
|
||||||
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
|
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
|
||||||
for a in ${CMAKE_CXX_SOURCES}; do
|
for a in ${CMAKE_CXX_SOURCES}; do
|
||||||
|
|
Loading…
Reference in New Issue