Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
2429dfc6
Commit
2429dfc6
authored
Mar 25, 2010
by
zhanyong.wan
Browse files
Cleans up the cmake script.
parent
b2c1ee6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
CMakeLists.txt
CMakeLists.txt
+15
-9
No files found.
CMakeLists.txt
View file @
2429dfc6
...
@@ -67,21 +67,26 @@ if (MSVC)
...
@@ -67,21 +67,26 @@ if (MSVC)
set
(
cxx_base_flags
"-GS -W4 -WX -wd4275 -nologo -J -Zi"
)
set
(
cxx_base_flags
"-GS -W4 -WX -wd4275 -nologo -J -Zi"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-D_UNICODE -DUNICODE -DWIN32 -D_WIN32"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-D_UNICODE -DUNICODE -DWIN32 -D_WIN32"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-DSTRICT -DWIN32_LEAN_AND_MEAN"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-DSTRICT -DWIN32_LEAN_AND_MEAN"
)
set
(
cxx_exception
s
_flags
"-EHsc -D_HAS_EXCEPTIONS=1"
)
set
(
cxx_exception_flags
"-EHsc -D_HAS_EXCEPTIONS=1"
)
set
(
cxx_no_exception_flags
"-D_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_exception_flags
"-D_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_rtti_flags
"-GR-"
)
set
(
cxx_no_rtti_flags
"-GR-"
)
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
cxx_base_flags
"-Wall -Wshadow"
)
set
(
cxx_base_flags
"-Wall -Wshadow"
)
set
(
cxx_exception
s
_flags
"-fexceptions"
)
set
(
cxx_exception_flags
"-fexceptions"
)
set
(
cxx_no_exception_flags
"-fno-exceptions"
)
set
(
cxx_no_exception_flags
"-fno-exceptions"
)
set
(
cxx_no_rtti_flags
"-fno-rtti"
)
# Until version 4.3.2, GCC doesn't define a macro to indicate
set
(
cxx_strict_flags
"
${
cxx_strict_flags
}
-Wextra"
)
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
# explicitly.
set
(
cxx_no_rtti_flags
"-fno-rtti -DGTEST_HAS_RTTI=0"
)
set
(
cxx_strict_flags
"-Wextra"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"SunPro"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"SunPro"
)
set
(
cxx_exceptions_flags
"-features=except"
)
set
(
cxx_exception_flags
"-features=except"
)
# Sun Pro doesn't provide macros to indicate whether exceptions and
# RTTI are enabled, so we define GTEST_HAS_* explicitly.
set
(
cxx_no_exception_flags
"-features=no%except -DGTEST_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_exception_flags
"-features=no%except -DGTEST_HAS_EXCEPTIONS=0"
)
set
(
cxx_no_rtti_flags
"-features=no%rtti"
)
set
(
cxx_no_rtti_flags
"-features=no%rtti
-DGTEST_HAS_RTTI=0
"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"VisualAge"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"VisualAge"
)
set
(
cxx_exception
s
_flags
"-qeh"
)
set
(
cxx_exception_flags
"-qeh"
)
set
(
cxx_no_exception_flags
"-qnoeh"
)
set
(
cxx_no_exception_flags
"-qnoeh"
)
set
(
cxx_no_rtti_flags
"-qnortti"
)
set
(
cxx_no_rtti_flags
"-qnortti"
)
endif
()
endif
()
...
@@ -91,10 +96,11 @@ if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available.
...
@@ -91,10 +96,11 @@ if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available.
endif
()
endif
()
# For building gtest's own tests and samples.
# For building gtest's own tests and samples.
set
(
cxx_
default
"
${
CMAKE_CXX_FLAGS
}
${
cxx_base_flags
}
${
cxx_exception
s
_flags
}
"
)
set
(
cxx_
exception
"
${
CMAKE_CXX_FLAGS
}
${
cxx_base_flags
}
${
cxx_exception_flags
}
"
)
set
(
cxx_no_exception
set
(
cxx_no_exception
"
${
CMAKE_CXX_FLAGS
}
${
cxx_base_flags
}
${
cxx_no_exception_flags
}
"
)
"
${
CMAKE_CXX_FLAGS
}
${
cxx_base_flags
}
${
cxx_no_exception_flags
}
"
)
set
(
cxx_no_rtti
"
${
cxx_default
}
${
cxx_no_rtti_flags
}
-DGTEST_HAS_RTTI=0"
)
set
(
cxx_default
"
${
cxx_exception
}
"
)
set
(
cxx_no_rtti
"
${
cxx_default
}
${
cxx_no_rtti_flags
}
"
)
set
(
cxx_use_own_tuple
"
${
cxx_default
}
-DGTEST_USE_OWN_TR1_TUPLE=1"
)
set
(
cxx_use_own_tuple
"
${
cxx_default
}
-DGTEST_USE_OWN_TR1_TUPLE=1"
)
# For building the gtest libraries.
# For building the gtest libraries.
...
...
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