opus_buildtype.cmake 787 B

123456789101112131415161718192021222324
  1. # Set a default build type if none was specified
  2. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  3. if(CMAKE_C_FLAGS)
  4. message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
  5. else()
  6. set(default_build_type "Release")
  7. message(
  8. STATUS
  9. "Setting build type to '${default_build_type}' as none was specified and no CFLAGS was exported."
  10. )
  11. set(CMAKE_BUILD_TYPE "${default_build_type}"
  12. CACHE STRING "Choose the type of build."
  13. FORCE)
  14. # Set the possible values of build type for cmake-gui
  15. set_property(CACHE CMAKE_BUILD_TYPE
  16. PROPERTY STRINGS
  17. "Debug"
  18. "Release"
  19. "MinSizeRel"
  20. "RelWithDebInfo")
  21. endif()
  22. endif()