Commit 8bb991d0 by Eric Fiselier

Remove BENCHMARK_ENABLE_SHARED and prefer BUILD_SHARED_LIBS

parent 9934396e
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")
......
......@@ -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:
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment