diff options
author | Alex Neundorf <neundorf@kde.org> | 2010-05-12 20:02:43 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2010-05-12 20:04:31 (GMT) |
commit | bca561ee46279684b938ce766984beab493fe55d (patch) | |
tree | 2ac5c58c394e3f8a4acf38fd5b741da25d0ca9e3 /Modules/CMakeASMInformation.cmake | |
parent | f2d18d6e998e96b9dbb6e07b08f208b65dc22f5e (diff) | |
download | CMake-bca561ee46279684b938ce766984beab493fe55d.zip CMake-bca561ee46279684b938ce766984beab493fe55d.tar.gz CMake-bca561ee46279684b938ce766984beab493fe55d.tar.bz2 |
-make CMAKE_ASM_FLAGS_INIT and friends work (#10577)
Alex
Diffstat (limited to 'Modules/CMakeASMInformation.cmake')
-rw-r--r-- | Modules/CMakeASMInformation.cmake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake index c495810..0fad25d 100644 --- a/Modules/CMakeASMInformation.cmake +++ b/Modules/CMakeASMInformation.cmake @@ -42,10 +42,45 @@ IF(NOT _INCLUDED_FILE) INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL) ENDIF(NOT _INCLUDED_FILE) +# Set default assembler file extensions: IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm) ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) + +# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends: +SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}") +# avoid just having a space as the initial value for the cache +IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") + SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT) +ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") +SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING + "Flags used by the assembler during all build types.") + +IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +# default build type is none + IF(NOT CMAKE_NO_BUILD_TYPE) + SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING + "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.") + ENDIF(NOT CMAKE_NO_BUILD_TYPE) + SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING + "Flags used by the assembler during debug builds.") + SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING + "Flags used by the assembler during release minsize builds.") + SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING + "Flags used by the assembler during release builds.") + SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING + "Flags used by the assembler during Release with Debug Info builds.") +ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + +MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS + CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG + CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL + CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE + CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO + ) + + IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>") ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) |