The previous hack (adding ${CMAKE_ASM_COMPILER} to CMAKE_ASM_FLAGS)
didn't work in all cases, because more recent versions of CMake place
the includes ahead of the flags (which meant that the real assembler
wasn't the first argument to gas-preprocessor.pl.)
return()
else()
message(STATUS "Using gas-preprocessor.pl")
- set(CMAKE_REAL_ASM_COMPILER ${CMAKE_ASM_COMPILER})
- set(CMAKE_ASM_COMPILER gas-preprocessor.pl)
- set(CMAKE_ASM_FLAGS "${CMAKE_REAL_ASM_COMPILER} ${CMAKE_ASM_FLAGS}")
+ configure_file(gas-preprocessor.in gas-preprocessor @ONLY)
+ set(CMAKE_ASM_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/gas-preprocessor)
endif()
else()
message(STATUS "GAS is working properly")
--- /dev/null
+gas-preprocessor.pl @CMAKE_ASM_COMPILER@ ${1+"$@"}