The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13510 
====================================================================== 
Reported By:                raspy
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13510
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-09-03 07:30 EDT
Last Modified:              2012-09-03 07:30 EDT
====================================================================== 
Summary:                    OBJECT_DIR is not expanded for Ninja generator
Description: 
Our compilation rule looks as follows:

<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -fr=<OBJECT_DIR> <SOURCE>

Trying to use Ninja generator fails:

CMake Error at
/home/user/cmake-2.8.9-Linux-i386/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
(MESSAGE):
  The C compiler "/path/to/cgtools/bin/cl6x" is not able
  to compile a simple test program.

  It fails with the following output:

   Change Dir: /path/to/build/CMakeFiles/CMakeTmp



  Run Build Command:/path/to/ninja
  cmTryCompileExec2716513962

  [1/2] Building C object
  CMakeFiles/cmTryCompileExec2716513962.dir/testCCompiler.obj

  FAILED: /path/to/cgtools/bin/cl6x -fr=OBJECT_DIR
  testCCompiler.c

  "/tmp/13712I59qtv", ERROR! at EOF: [E1500] file access error: failed to
  open

                                               "OBJECT_DIR/testCCompiler.obj"
for
                                               writing

  "/tmp/13712I59qtv", ERROR! : [E1000] Failed to write object file :

                                        OBJECT_DIR/testCCompiler.obj



  >> Compilation failure

  ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.


Steps to Reproduce: 
Use:

SET(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <FLAGS>
-fr=<OBJECT_DIR> <SOURCE>")

Then run cmake -G Ninja .

Additional Information: 
It seems that cmNinjaTargetGenerator::WriteCompileRule
(Source/cmNinjaTargetGenerator.cxx:335) does not define ObjectDir in variables
as Unix Generator does.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-09-03 07:30 raspy          New Issue                                    
======================================================================

--

Powered by www.kitware.com

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

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

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

Reply via email to