mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-21 18:45:49 +00:00
build system: check for Google Benchmark, compile benchmark if source exists
This commit is contained in:
parent
2421163189
commit
abb66a5486
1
.gitignore
vendored
1
.gitignore
vendored
@ -51,6 +51,7 @@
|
||||
/rake.d/dependency.d
|
||||
/share/icons/*/*.h
|
||||
/src/*/qt_resources.cpp
|
||||
/src/benchmark/
|
||||
/src/common/common.h.gch
|
||||
/src/common/common_pch.h.[gp]ch
|
||||
/src/common/common_pch.h.pch-????????
|
||||
|
18
Rakefile
18
Rakefile
@ -115,6 +115,8 @@ def setup_globals
|
||||
$unwrapped_po = %{ca es eu it nl uk pl sr_RS@latin tr}
|
||||
$po_multiple_sources = %{sv}
|
||||
|
||||
$benchmark_sources = FileList["src/benchmark/*.cpp"].to_a if c?(:GOOGLE_BENCHMARK)
|
||||
|
||||
cflags_common = "-Wall -Wno-comment -Wfatal-errors #{c(:WLOGICAL_OP)} #{c(:WNO_MISMATCHED_TAGS)} #{c(:WNO_SELF_ASSIGN)} #{c(:QUNUSED_ARGUMENTS)}"
|
||||
cflags_common += " #{c(:WNO_INCONSISTENT_MISSING_OVERRIDE)} #{c(:WNO_POTENTIALLY_EVALUATED_EXPRESSION)}"
|
||||
cflags_common += " #{c(:OPTIMIZATION_CFLAGS)} -D_FILE_OFFSET_BITS=64"
|
||||
@ -211,6 +213,8 @@ def define_default_task
|
||||
# needed for running the tests.
|
||||
targets << "apps:tools:ebml_validator" if c(:host) == c(:build)
|
||||
|
||||
targets << "src/benchmark/benchmark" if c?(:GOOGLE_BENCHMARK) && !$benchmark_sources.empty?
|
||||
|
||||
task :default => targets do
|
||||
puts "Done. Enjoy :)"
|
||||
end
|
||||
@ -843,6 +847,7 @@ task :clean do
|
||||
src/*/qt_resources.cpp
|
||||
src/info/ui/*.h
|
||||
src/mkvtoolnix-gui/forms/**/*.h
|
||||
src/benchmark/benchmark
|
||||
tests/unit/all
|
||||
tests/unit/merge/merge
|
||||
tests/unit/propedit/propedit
|
||||
@ -1057,6 +1062,19 @@ if $build_mkvtoolnix_gui
|
||||
create
|
||||
end
|
||||
|
||||
#
|
||||
# benchmark
|
||||
#
|
||||
|
||||
if c?(:GOOGLE_BENCHMARK) && !$benchmark_sources.empty?
|
||||
Application.new("src/benchmark/benchmark").
|
||||
description("Build the benchmark executable").
|
||||
aliases(:benchmark, :bench).
|
||||
sources($benchmark_sources).
|
||||
libraries($common_libs, :benchmark).
|
||||
create
|
||||
end
|
||||
|
||||
#
|
||||
# Applications in src/tools
|
||||
#
|
||||
|
16
ac/benchmark.m4
Normal file
16
ac/benchmark.m4
Normal file
@ -0,0 +1,16 @@
|
||||
AC_DEFUN([AX_GOOGLE_BENCHMARK],[
|
||||
GOOGLE_BENCHMARK=yes
|
||||
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
AC_LANG_PUSH(C++)
|
||||
|
||||
AC_CHECK_LIB([benchmark],[main],[true],[GOOGLE_BENCHMARK=no])
|
||||
AC_CHECK_HEADERS([benchmark/benchmark.h],[true],[GOOGLE_BENCHMARK=no])
|
||||
|
||||
AC_LANG_POP
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
|
||||
AC_SUBST(GOOGLE_BENCHMARK)
|
||||
])
|
||||
|
||||
AX_GOOGLE_BENCHMARK
|
@ -87,6 +87,7 @@ EGREP = @EGREP@
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
||||
FSTACK_PROTECTOR = @FSTACK_PROTECTOR@
|
||||
GOOGLE_BENCHMARK = @GOOGLE_BENCHMARK@
|
||||
GTEST_TYPE = @GTEST_TYPE@
|
||||
LDFLAGS_RPATHS = @LDFLAGS_RPATHS@
|
||||
FLAC_LIBS = @FLAC_LIBS@
|
||||
|
@ -44,6 +44,7 @@ m4_include(ac/ax_boost_system.m4)
|
||||
m4_include(ac/ax_boost_date_time.m4)
|
||||
m4_include(ac/boost.m4)
|
||||
m4_include(ac/gtest.m4)
|
||||
m4_include(ac/benchmark.m4)
|
||||
m4_include(ac/pandoc.m4)
|
||||
m4_include(ac/ax_docbook.m4)
|
||||
m4_include(ac/tiocgwinsz.m4)
|
||||
|
Loading…
Reference in New Issue
Block a user