Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
c7108df9
Commit
c7108df9
authored
May 23, 2016
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only compile and run the C++03 test when -std=c++03 is supported. Fixes #164
parent
f434ce3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
CMakeLists.txt
test/CMakeLists.txt
+12
-8
No files found.
test/CMakeLists.txt
View file @
c7108df9
...
...
@@ -2,10 +2,6 @@
find_package
(
Threads REQUIRED
)
set
(
CXX03_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"-std=c++11"
"-std=c++03"
CXX03_FLAGS
"
${
CXX03_FLAGS
}
"
)
string
(
REPLACE
"-std=c++0x"
"-std=c++03"
CXX03_FLAGS
"
${
CXX03_FLAGS
}
"
)
macro
(
compile_benchmark_test name
)
add_executable
(
${
name
}
"
${
name
}
.cc"
)
target_link_libraries
(
${
name
}
benchmark
${
CMAKE_THREAD_LIBS_INIT
}
)
...
...
@@ -42,10 +38,18 @@ add_test(fixture_test fixture_test --benchmark_min_time=0.01)
compile_benchmark_test
(
map_test
)
add_test
(
map_test map_test --benchmark_min_time=0.01
)
compile_benchmark_test
(
cxx03_test
)
set_target_properties
(
cxx03_test
PROPERTIES COMPILE_FLAGS
"
${
CXX03_FLAGS
}
"
)
add_test
(
cxx03 cxx03_test --benchmark_min_time=0.01
)
check_cxx_compiler_flag
(
-std=c++03 BENCHMARK_HAS_CXX03_FLAG
)
if
(
BENCHMARK_HAS_CXX03_FLAG
)
set
(
CXX03_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"-std=c++11"
"-std=c++03"
CXX03_FLAGS
"
${
CXX03_FLAGS
}
"
)
string
(
REPLACE
"-std=c++0x"
"-std=c++03"
CXX03_FLAGS
"
${
CXX03_FLAGS
}
"
)
compile_benchmark_test
(
cxx03_test
)
set_target_properties
(
cxx03_test
PROPERTIES COMPILE_FLAGS
"
${
CXX03_FLAGS
}
"
)
add_test
(
cxx03 cxx03_test --benchmark_min_time=0.01
)
endif
()
# Add the coverage command(s)
if
(
CMAKE_BUILD_TYPE
)
...
...
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