CMakeASMInformation.cmake 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #=============================================================================
  2. # Copyright 2007-2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. MESSAGE(STATUS "Loaded CMakeASM${ASM_DIALECT}Information - ASM${ASM_DIALECT} support is still experimental, please report issues")
  14. IF(UNIX)
  15. SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
  16. ELSE(UNIX)
  17. SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
  18. ENDIF(UNIX)
  19. SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
  20. SET(CMAKE_BASE_NAME)
  21. GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
  22. IF("${CMAKE_BASE_NAME}" STREQUAL "as")
  23. SET(CMAKE_BASE_NAME gas)
  24. ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
  25. # Load compiler-specific information.
  26. SET(_INCLUDED_FILE "")
  27. IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
  28. INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
  29. ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
  30. IF(NOT _INCLUDED_FILE)
  31. INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
  32. ENDIF(NOT _INCLUDED_FILE)
  33. IF(CMAKE_SYSTEM_PROCESSOR)
  34. INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
  35. IF(NOT _INCLUDED_FILE)
  36. INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
  37. ENDIF(NOT _INCLUDED_FILE)
  38. ENDIF(CMAKE_SYSTEM_PROCESSOR)
  39. INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
  40. IF(NOT _INCLUDED_FILE)
  41. INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
  42. ENDIF(NOT _INCLUDED_FILE)
  43. # Set default assembler file extensions:
  44. IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
  45. SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
  46. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
  47. # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
  48. SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
  49. # avoid just having a space as the initial value for the cache
  50. IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
  51. SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
  52. ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
  53. SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
  54. "Flags used by the assembler during all build types.")
  55. IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  56. # default build type is none
  57. IF(NOT CMAKE_NO_BUILD_TYPE)
  58. SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
  59. "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
  60. ENDIF(NOT CMAKE_NO_BUILD_TYPE)
  61. SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
  62. "Flags used by the assembler during debug builds.")
  63. SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
  64. "Flags used by the assembler during release minsize builds.")
  65. SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
  66. "Flags used by the assembler during release builds.")
  67. SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
  68. "Flags used by the assembler during Release with Debug Info builds.")
  69. ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  70. MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
  71. CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
  72. CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
  73. CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
  74. CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO
  75. )
  76. IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
  77. SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
  78. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
  79. IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
  80. SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
  81. "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
  82. "<CMAKE_RANLIB> <TARGET> ")
  83. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
  84. IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
  85. SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
  86. "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
  87. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
  88. # to be done
  89. IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
  90. SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
  91. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
  92. IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
  93. SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
  94. ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
  95. SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)