MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0008170 | CMake | CMake | public | 2008-11-25 10:44 | 2015-04-06 09:07 |
|
Reporter | Thorsten Köster | |
Assigned To | | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | | OS Version | |
Product Version | CMake-2-6 | |
Target Version | CMake 3.1 | Fixed in Version | CMake 3.1 | |
|
Summary | 0008170: Visual Studio 9 generator does not output Custom Build Tool command line for assembler sources |
Description | I basically have the following CMakeLists.txt (reduced for clarity) which I would like to use for building a static library consisting of both C++ and assembler sources:
PROJECT(${lib_name} CXX ASM-ATT)
ADD_LIBRARY(${lib_name} STATIC ${CXX_SRCS} ${ASM_SRCS})
# I'm paranoid right now, so try to force CMake...
SET_SOURCE_FILES_PROPERTIES(${ASM_SRCS} PROPERTIES LANGUAGE ASM-ATT)
SET_SOURCE_FILES_PROPERTIES(${CXX_SRCS} PROPERTIES LANGUAGE CXX)
The assembler (MinGW as) seems to be detected correctly, and when I generate an Eclipse project with Unix makefiles, the command line shows up correctly. When I try the same in Visual Studio, the configuration for the ${ASM_SRCS}-files will be set to "Custom Build Tool", but no command line will be issued (verified in .vcproj file). |
Steps To Reproduce | |
Additional Information | |
Tags | asm, masm, msvc, studio, visual, visual studio |
Relationships | has duplicate | 0014984 | closed | | Assembler config not working (in VS2005, with partial solution,with zlib-1.2.8) | related to | 0009905 | closed | | Support for .asm files in the Visual Studio generators | related to | 0011536 | closed | Patrick R. Gansterer | Can't use assembler files with Visual Studio 10 generator | related to | 0010848 | closed | Kitware Robot | Issue with space in paths used for <OBJECT> and <SOURCE> in CMAKE_ASM |
|
Attached Files | vs_asm.diff (15,413) 2010-02-23 13:04 https://public.kitware.com/Bug/file/2895/vs_asm.diff custom-build.zip (965) 2010-03-14 08:00 https://public.kitware.com/Bug/file/2969/custom-build.zip cmLocalGenerator.diff (1,624) 2010-04-13 07:35 https://public.kitware.com/Bug/file/3023/cmLocalGenerator.diff 0001-generator-expression.patch (3,386) 2012-08-20 13:09 https://public.kitware.com/Bug/file/4428/0001-generator-expression.patch 0002-visual-studio-assembly-files.patch (8,112) 2012-08-20 13:09 https://public.kitware.com/Bug/file/4429/0002-visual-studio-assembly-files.patch 0001-asm_file_support_vs2010_vs2012.patch (2,556) 2012-10-25 17:54 https://public.kitware.com/Bug/file/4541/0001-asm_file_support_vs2010_vs2012.patch 0001-new_asm_file_support_vs2010_vs2012.patch (2,566) 2013-06-05 10:04 https://public.kitware.com/Bug/file/4779/0001-new_asm_file_support_vs2010_vs2012.patch |
|
Issue History |
Date Modified | Username | Field | Change |
2008-11-25 10:44 | Thorsten Köster | New Issue | |
2008-11-25 11:02 | Thorsten Köster | Note Added: 0014180 | |
2009-02-12 12:27 | Bill Hoffman | Note Added: 0014915 | |
2009-02-12 12:27 | Bill Hoffman | Status | new => assigned |
2009-02-12 12:27 | Bill Hoffman | Assigned To | => Bill Hoffman |
2010-02-23 13:04 | Brian Bassett | Note Added: 0019597 | |
2010-02-23 13:04 | Brian Bassett | File Added: vs_asm.diff | |
2010-02-23 16:11 | Brian Bassett | Note Edited: 0019597 | |
2010-03-14 08:00 | db | Note Added: 0019873 | |
2010-03-14 08:00 | db | File Added: custom-build.zip | |
2010-04-13 07:35 | Maxim Kizub | File Added: cmLocalGenerator.diff | |
2010-04-13 07:38 | Maxim Kizub | Note Added: 0020150 | |
2010-10-18 20:37 | viktor11111 | Note Added: 0022529 | |
2010-10-18 20:52 | viktor11111 | Tag Attached: msvc | |
2010-10-18 20:52 | viktor11111 | Tag Attached: studio | |
2010-10-18 20:52 | viktor11111 | Tag Attached: visual | |
2010-10-18 20:52 | viktor11111 | Tag Attached: visual studio | |
2010-10-18 20:52 | viktor11111 | Tag Attached: asm | |
2010-10-18 20:52 | viktor11111 | Tag Attached: masm | |
2010-12-15 09:04 | David Cole | Relationship added | related to 0009905 |
2011-03-10 15:05 | Alex Neundorf | Relationship added | related to 0011536 |
2011-03-10 15:11 | Alex Neundorf | Relationship added | related to 0010848 |
2011-04-14 14:17 | David Cole | Target Version | => CMake 2.8.5 |
2011-05-25 16:58 | David Cole | Note Added: 0026592 | |
2011-05-25 16:58 | David Cole | Target Version | CMake 2.8.5 => |
2012-02-09 11:52 | Amine Khaldi | Note Added: 0028545 | |
2012-08-06 21:10 | Amine Khaldi | Note Added: 0030179 | |
2012-08-20 11:48 | David Cole | Assigned To | Bill Hoffman => |
2012-08-20 11:48 | David Cole | Status | assigned => new |
2012-08-20 11:48 | David Cole | Target Version | => CMake 2.8.10 |
2012-08-20 13:09 | Brian Bassett | Note Added: 0030710 | |
2012-08-20 13:09 | Brian Bassett | File Added: 0001-generator-expression.patch | |
2012-08-20 13:09 | Brian Bassett | File Added: 0002-visual-studio-assembly-files.patch | |
2012-08-20 15:42 | Amine Khaldi | Note Added: 0030711 | |
2012-08-20 15:54 | David Cole | Note Added: 0030712 | |
2012-08-20 16:48 | Brian Bassett | Note Added: 0030713 | |
2012-08-20 17:08 | Amine Khaldi | Note Added: 0030714 | |
2012-10-18 11:16 | David Cole | Target Version | CMake 2.8.10 => CMake 2.8.11 |
2012-10-18 11:17 | David Cole | Note Added: 0031259 | |
2012-10-25 17:54 | viktor11111 | File Added: 0001-asm_file_support_vs2010_vs2012.patch | |
2012-10-25 18:12 | viktor11111 | Note Added: 0031337 | |
2012-10-25 18:21 | viktor11111 | Note Edited: 0031337 | bug_revision_view_page.php?bugnote_id=31337#r875 |
2012-10-25 18:24 | viktor11111 | Note Edited: 0031337 | bug_revision_view_page.php?bugnote_id=31337#r876 |
2012-10-25 18:28 | viktor11111 | Note Edited: 0031337 | bug_revision_view_page.php?bugnote_id=31337#r877 |
2013-02-12 16:41 | viktor11111 | Note Added: 0032252 | |
2013-05-17 09:33 | Robert Maynard | Target Version | CMake 2.8.11 => CMake 2.8.12 |
2013-05-31 07:50 | Bud | Note Added: 0033159 | |
2013-06-05 10:04 | viktor11111 | File Added: 0001-new_asm_file_support_vs2010_vs2012.patch | |
2013-06-05 10:06 | viktor11111 | Note Added: 0033244 | |
2013-07-29 02:38 | db | Note Added: 0033624 | |
2013-08-06 17:39 | Amine Khaldi | Note Added: 0033674 | |
2013-08-08 01:22 | db | Note Added: 0033680 | |
2014-06-24 14:55 | Brad King | Relationship added | has duplicate 0014984 |
2014-08-22 10:40 | Brad King | Note Added: 0036668 | |
2014-08-22 10:40 | Brad King | Target Version | CMake 2.8.12 => CMake 3.1 |
2014-10-03 09:19 | Brad King | Status | new => resolved |
2014-10-03 09:19 | Brad King | Resolution | open => fixed |
2014-10-03 09:19 | Brad King | Fixed in Version | => CMake 3.1 |
2015-04-06 09:07 | Robert Maynard | Note Added: 0038413 | |
2015-04-06 09:07 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0014180)
|
Thorsten Köster
|
2008-11-25 11:02
|
|
I even added
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES LINKER_LANGUAGE CXX)
but that didn't help, either. When I added
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES LINKER_LANGUAGE ASM-ATT)
though, each and every file would suddenly have been compiled using the assembler. |
|
|
(0014915)
|
Bill Hoffman
|
2009-02-12 12:27
|
|
Right now the asm stuff is not really supported in the vs generators... |
|
|
(0019597)
|
Brian Bassett
|
2010-02-23 13:04
(edited on: 2010-02-23 16:11) |
|
I've put together a patch that fixes this issue for those Visual Studio generators that use the Visual Studio 7 local generator (we're using CMake for an internal project, and only needed to support VS2008). The patch adds the concept of a "multi-config custom command" (which is basically a map of configurations to custom commands). This is not exposed to the user, and only used internally to the generator.
This patch also happens to have the benefit of being general (i.e. it isn't limited to assembler), but handles any generating objects for any language that the generator doesn't already know about (i.e. C, CXX, IDL, RC, DEF, and Fortran).
|
|
|
(0019873)
|
db
|
2010-03-14 08:00
|
|
Good job! That's what I'm waiting for a long time. Unfortunately it does not work entirely correctly with generated sources. In the attached example test2.asm is initially filled with "Artificial dependency for a custom command." and is not re-generated during Visual Studio build. With nmake generator it's generated as expected. |
|
|
(0020150)
|
Maxim Kizub
|
2010-04-13 07:38
|
|
We have the same issue, and to compile our project I've make a quick fix in file cmLocalGenerator.cxx
We use "yasm.exe" assembler and ASM language.
Maybe this patch, used as example, will help the fix the bug. |
|
|
(0022529)
|
viktor11111
|
2010-10-18 20:37
|
|
Please apply this patch "cmLocalGenerator.diff" in main branche, because that bug is still reproduced. |
|
|
(0026592)
|
David Cole
|
2011-05-25 16:58
|
|
Not for 2.8.5 - postponing until a future release |
|
|
(0028545)
|
Amine Khaldi
|
2012-02-09 11:52
|
|
Please note that this bug is blocking us (ReactOS) from using the VS generators, and msbuild specifically, so our only option right now is the one core nmake builds where asm files are handled correctly. |
|
|
(0030179)
|
Amine Khaldi
|
2012-08-06 21:10
|
|
|
|
(0030710)
|
Brian Bassett
|
2012-08-20 13:09
|
|
I've updated my patch to move away from my (admittedly funky) multi-config custom command concept to use a new generator expression ($<CONFIG_SPECIFIC:...>) to expand the correct flags. (The patch is now in two chunks, one that implements the new generator expression, and the other that updates the generators.) |
|
|
(0030711)
|
Amine Khaldi
|
2012-08-20 15:42
|
|
Hi,
First of all thank you for working on this.
Did you perhaps miss <DEFINES> expansion ? I didn't see it mentioned anywhere, when I (superficially) looked at the patch. |
|
|
(0030712)
|
David Cole
|
2012-08-20 15:54
|
|
|
|
(0030713)
|
Brian Bassett
|
2012-08-20 16:48
|
|
@Amine: Yes and no. I didn't expand <DEFINES>, but that was because none of the three supported assemblers (MASM, NASM, or ATT) use <DEFINES> in their CMAKE_ASM*_COMPILE_OBJECT declaration. |
|
|
(0030714)
|
Amine Khaldi
|
2012-08-20 17:08
|
|
@Brian: Ah I see. We do use them (ReactOS) so I would appreciate adding the expansion here. I'll test the patch as soon as you upload it, and report back. Thank you in advance ;) |
|
|
(0031259)
|
David Cole
|
2012-10-18 11:17
|
|
|
|
(0031337)
|
viktor11111
|
2012-10-25 18:12
(edited on: 2012-10-25 18:28) |
|
|
|
(0032252)
|
viktor11111
|
2013-02-12 16:41
|
|
|
|
(0033159)
|
Bud
|
2013-05-31 07:50
|
|
+1; I'm hoping this patch is in 2.8.12, it's been holding me up for months. |
|
|
(0033244)
|
viktor11111
|
2013-06-05 10:06
|
|
update patch for last revision
"0001-new_asm_file_support_vs2010_vs2012.patch"
please check and commit it in main branch |
|
|
(0033624)
|
db
|
2013-07-29 02:38
|
|
viktor11111, your solution is only partial because it does not support anything different from MASM. There are other assemblers in the world (e.g. yasm, jwasm etc.) So I would prefer Maxim Kizub's way (cmLocalGenerator.diff). Maxim, can you update your patch for the latest CMake/Visual studio 2012? |
|
|
(0033674)
|
Amine Khaldi
|
2013-08-06 17:39
|
|
Please note, the patch mentioned here and in http://www.cmake.org/Bug/view.php?id=11536 [^] doesn't solve the preprocessed asm source files case. The work started by Brian Bassett is the closest thing to having proper handling of the most widely used form of asm source files (you rarely add asm source files without preprocessing). It would be great to have that picked up so that we (ReactOS at least) can finally compile with VS. Thanks. |
|
|
(0033680)
|
db
|
2013-08-08 01:22
|
|
@Amine: indeed, Brian Bassett's patch seems to be the most universal one. Has anyone updated it for CMake 2.8.11? |
|
|
(0036668)
|
Brad King
|
2014-08-22 10:40
|
|
|
|
(0038413)
|
Robert Maynard
|
2015-04-06 09:07
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|