CMakeCommonLanguageInclude.cmake 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # this file has flags that are shared across languages and sets
  2. # cache values that can be initialized in the platform-compiler.cmake file
  3. # it may be included by more than one language.
  4. SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
  5. CACHE STRING "Flags used by the linker.")
  6. IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  7. # default build type is none
  8. IF(NOT CMAKE_NO_BUILD_TYPE)
  9. SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
  10. "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
  11. ENDIF(NOT CMAKE_NO_BUILD_TYPE)
  12. SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  13. "Flags used by the linker during debug builds.")
  14. SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
  15. "Flags used by the linker during release minsize builds.")
  16. SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING
  17. "Flags used by the linker during release builds.")
  18. SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
  19. ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  20. "Flags used by the linker during Release with Debug Info builds.")
  21. SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  22. "Flags used by the linker during debug builds.")
  23. SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
  24. CACHE STRING
  25. "Flags used by the linker during release minsize builds.")
  26. SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING
  27. "Flags used by the linker during release builds.")
  28. SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
  29. ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  30. "Flags used by the linker during Release with Debug Info builds.")
  31. SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  32. "Flags used by the linker during debug builds.")
  33. SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
  34. CACHE STRING
  35. "Flags used by the linker during release minsize builds.")
  36. SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING
  37. "Flags used by the linker during release builds.")
  38. SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
  39. ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  40. "Flags used by the linker during Release with Debug Info builds.")
  41. ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  42. # shared linker flags
  43. SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
  44. CACHE STRING "Flags used by the linker during the creation of dll's.")
  45. # module linker flags
  46. SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}
  47. CACHE STRING "Flags used by the linker during the creation of modules.")
  48. SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
  49. "What is the target build tool cmake is generating for.")
  50. MARK_AS_ADVANCED(
  51. CMAKE_BUILD_TOOL
  52. CMAKE_VERBOSE_MAKEFILE
  53. CMAKE_EXE_LINKER_FLAGS
  54. CMAKE_EXE_LINKER_FLAGS_DEBUG
  55. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
  56. CMAKE_EXE_LINKER_FLAGS_RELEASE
  57. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
  58. CMAKE_SHARED_LINKER_FLAGS
  59. CMAKE_SHARED_LINKER_FLAGS_DEBUG
  60. CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
  61. CMAKE_SHARED_LINKER_FLAGS_RELEASE
  62. CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
  63. CMAKE_MODULE_LINKER_FLAGS
  64. CMAKE_MODULE_LINKER_FLAGS_DEBUG
  65. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
  66. CMAKE_MODULE_LINKER_FLAGS_RELEASE
  67. CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
  68. )