Hi,

We are using the IAR toolchain for cross-compiling parts of our builds and encountered a problem when we recently enabled response files for our Windows builds. It seems that the syntax used for the response file flags on the IAR compilers is wrong, we needed to insert a space after the '-f' to make it work.

I attached a patch that fixes the problem in our environment.

We are building with the 'Unix Makefiles' generator from a Cygwin shell in Windows. Can someone confirm that this is a proper fix for our issues and whether it would make sense to have the patch merged into the CMake trunk?

Thanks & best regards,
Andreas
Index: share/cmake-3.8/Modules/Compiler/IAR-C.cmake
===================================================================
--- share/cmake-3.8/Modules/Compiler/IAR-C.cmake        (revision 15921)
+++ share/cmake-3.8/Modules/Compiler/IAR-C.cmake        (working copy)
@@ -7,7 +7,7 @@
 set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> 
<INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
 set(CMAKE_C_CREATE_ASSEMBLY_SOURCE     "<CMAKE_C_COMPILER> <SOURCE> <DEFINES> 
<INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
 
-set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f")
+set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f ")
 set(CMAKE_DEPFILE_FLAGS_C "--dependencies=ns <DEPFILE>")
 
 # The toolchains for ARM and AVR are quite different:
Index: share/cmake-3.8/Modules/Compiler/IAR-CXX.cmake
===================================================================
--- share/cmake-3.8/Modules/Compiler/IAR-CXX.cmake      (revision 15921)
+++ share/cmake-3.8/Modules/Compiler/IAR-CXX.cmake      (working copy)
@@ -7,7 +7,7 @@
 set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <SOURCE> 
<DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
 set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE     "<CMAKE_CXX_COMPILER> <SOURCE> 
<DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
 
-set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "-f")
+set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "-f ")
 set(CMAKE_DEPFILE_FLAGS_CXX "--dependencies=ns <DEPFILE>")
 
 if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM")
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to