mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 06:40:48 -06:00
Fix Assembler test to parse C flags string before using
Commit 1f6c6b1c (use CMAKE_C_FLAGS when generating the assembler file,
2011-03-03) added use of CMAKE_C_FLAGS to the assembler generation step.
However, this variable is meant for direct substitution into a shell
command line so we need to parse it to separate the arguments first.
This commit is contained in:
@@ -7,7 +7,9 @@ set(SRCS)
|
||||
# and also generate assembler files from C:
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Makefile")
|
||||
if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX))
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -S "${CMAKE_CURRENT_SOURCE_DIR}/main.c" -o "${CMAKE_CURRENT_BINARY_DIR}/main.s")
|
||||
set(C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
separate_arguments(C_FLAGS)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS} -S "${CMAKE_CURRENT_SOURCE_DIR}/main.c" -o "${CMAKE_CURRENT_BINARY_DIR}/main.s")
|
||||
set(SRCS "${CMAKE_CURRENT_BINARY_DIR}/main.s")
|
||||
endif(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX))
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Makefile")
|
||||
|
||||
Reference in New Issue
Block a user