Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
cf92ec3b
Commit
cf92ec3b
authored
Mar 18, 2014
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify CheckTypeSize.cmake module so it works with older CMake versions.
parent
1e0b54c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
CMakeLists.txt
CMakeLists.txt
+9
-6
CheckTypeSize.cmake
cmake/CheckTypeSize.cmake
+4
-3
No files found.
CMakeLists.txt
View file @
cf92ec3b
...
...
@@ -65,14 +65,17 @@ include (CheckIncludeFileCXX)
include
(
CheckCXXSymbolExists
)
set
(
GFLAGS_INTTYPES_FORMAT
""
CACHE STRING
"Format of integer types:
\"
C99
\"
(uint32_t),
\"
BSD
\"
(u_int32_t),
\"
VC7
\"
(__int32)"
)
set_property
(
CACHE GFLAGS_INTTYPES_FORMAT PROPERTY STRINGS
"C99;BSD;VC7"
)
mark_as_advanced
(
GFLAGS_INTTYPES_FORMAT
)
if
(
NOT GFLAGS_INTTYPES_FORMAT
)
foreach
(
type IN ITEMS uint32_t u_int32_t __int32
)
check_type_size
(
${
type
}
SIZE LANGUAGE CXX
)
if
(
SIZE
)
set
(
HAVE_
${
type
}
TRUE
)
else
()
set
(
HAVE_
${
type
}
FALSE
)
set
(
TYPES uint32_t u_int32_t
)
if
(
MSVC
)
list
(
INSERT TYPES 0 __int32
)
endif
()
foreach
(
type IN LISTS TYPES
)
check_type_size
(
${
type
}
${
type
}
LANGUAGE CXX
)
if
(
HAVE_
${
type
}
)
break
()
endif
()
endforeach
()
if
(
HAVE_uint32_t
)
...
...
cmake/CheckTypeSize.cmake
View file @
cf92ec3b
# Copied from master branch of CMake (commit SHA 34a49dea) and
# modified to use CheckIncludeFileCXX instead of CheckIncludeFile
# when the LANGUAGE is CXX.
# when the LANGUAGE is CXX. Modified the try_compile call to
# not pass any LINK_LIBRARIES as this option is only supported by
# CMake since version 2.8.11
# -andreas
#.rst:
# CheckTypeSize
...
...
@@ -62,7 +65,6 @@
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
#=============================================================================
...
...
@@ -121,7 +123,6 @@ function(__check_type_size_impl type var map builtin language)
configure_file
(
${
__check_type_size_dir
}
/CheckTypeSize.c.in
${
src
}
@ONLY
)
try_compile
(
HAVE_
${
var
}
${
CMAKE_BINARY_DIR
}
${
src
}
COMPILE_DEFINITIONS
${
CMAKE_REQUIRED_DEFINITIONS
}
LINK_LIBRARIES
${
CMAKE_REQUIRED_LIBRARIES
}
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=
${
CMAKE_REQUIRED_FLAGS
}
"
"-DINCLUDE_DIRECTORIES:STRING=
${
CMAKE_REQUIRED_INCLUDES
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment