Remove BENCHMARK_ENABLE_SHARED and prefer BUILD_SHARED_LIBS

This commit is contained in:
Eric Fiselier 2015-04-01 11:34:38 -04:00
parent 9934396e1f
commit 8bb991d099
3 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,6 @@
cmake_minimum_required (VERSION 2.8)
project (benchmark)
option(BENCHMARK_ENABLE_SHARED "Enable building a shared library." OFF)
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
# Make sure we can import out CMake functions
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

View File

@ -42,7 +42,7 @@ before_build:
- if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
build_script:
- cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%variant%" "-DBENCHMARK_ENABLE_SHARED=%shared%"
- cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%variant%" "-DBUILD_SHARED_LIBS=%shared%"
- cmd /c "%build%"
test_script:

View File

@ -17,13 +17,12 @@ else()
message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
endif()
add_library(benchmark ${SOURCE_FILES} ${RE_FILES})
# Build the benchmark library
if (BENCHMARK_ENABLE_SHARED)
add_library(benchmark SHARED ${SOURCE_FILES} ${RE_FILES})
if (BUILD_SHARED_LIBS)
find_package(Threads REQUIRED)
target_link_libraries(benchmark ${CMAKE_THREAD_LIBS_INIT})
else()
add_library(benchmark STATIC ${SOURCE_FILES} ${RE_FILES})
endif()
set_target_properties(benchmark PROPERTIES