You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8KB

  1. cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
  2. project(c++-benchmarks CXX)
  3. include(CMakeDetermineCXXCompiler)
  4. # default to Release
  5. if("${CMAKE_BUILD_TYPE}" STREQUAL "")
  6. set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
  7. endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
  8. if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  9. set(EXTRA_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wno-unused-parameter -pedantic" CACHE STRING "Extra flags used by the compiler during all build types.")
  10. else("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  11. set(EXTRA_CXX_FLAGS "" CACHE STRING "Extra flags used by the compiler during all build types.")
  12. endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  13. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
  14. add_executable(benchmark-atomic-costs
  15. benchmark-atomic-costs.cpp)
  16. add_executable(benchmark-atomic-costs-pthread
  17. benchmark-atomic-costs.cpp)
  18. set_target_properties(benchmark-atomic-costs-pthread
  19. PROPERTIES
  20. COMPILE_FLAGS "-pthread"
  21. LINK_FLAGS "-pthread")
  22. add_executable(benchmark-shared-unique
  23. benchmark-shared-unique.cpp
  24. benchmark-shared-unique-impl.cpp)
  25. add_executable(test-NULL-type
  26. test-NULL-type.cpp)
  27. add_executable(test-base-constr
  28. test-base-constr.cpp)
  29. add_executable(test-const-ref-results
  30. test-const-ref-results.cpp)
  31. add_executable(test-constructor-throw
  32. test-constructor-throw.cpp)
  33. add_executable(test-copy-shared-ptr
  34. test-copy-shared-ptr.cpp
  35. test-copy-shared-ptr-impl.cpp)
  36. add_executable(test-rvalue-ref
  37. test-rvalue-ref.cpp)
  38. add_executable(test-smart-factory
  39. test-smart-factory.cpp)