CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2023-04-26T15:28:50-04:00https://gitlab.kitware.com/cmake/cmake/-/issues/24797VS: The MASM change added in 3.26.x breaks VS ARM64 build2023-04-26T15:28:50-04:00Changming SunVS: The MASM change added in 3.26.x breaks VS ARM64 buildYou can get a reproducible example from https://gitlab.kitware.com/cmake/cmake/-/issues/21462 . Try it on a Windows ARM64 machine with Visual Studio 2022 ARM64 version. To get VS 2022 ARM64 version, just install it normally. The ARM64 ve...You can get a reproducible example from https://gitlab.kitware.com/cmake/cmake/-/issues/21462 . Try it on a Windows ARM64 machine with Visual Studio 2022 ARM64 version. To get VS 2022 ARM64 version, just install it normally. The ARM64 version and x86 version share the same installer. Then build the sample. cmake 3.25.x works fine, while cmake 3.26.x does not. Error message with cmake 3.26:
```
2>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "echo MASM not supported on this platform
```
I also submitted an issue to VS: https://developercommunity.visualstudio.com/t/Does-Visual-Studio-Windows-ARM64-version/10331301?viewtype=all . I'm not sure it is a limitation of cmake or VS, but definitely this is a breaking change for cmake.https://gitlab.kitware.com/cmake/cmake/-/issues/24304ASM_MARMASM: The CMAKE_ASM_MARMASM_FLAGS are not getting inside the .asm2023-02-13T11:46:29-05:00Randeep KumarASM_MARMASM: The CMAKE_ASM_MARMASM_FLAGS are not getting inside the .asmHi Team,
The CMAKE_ASM_FLAGS are not getting inside the .asm files when compiled using armasm.
I'm trying this using the nightly build in which the .asm compilation is fixed for the armasm assembler. (#24134)
The new issue I'm facing is ...Hi Team,
The CMAKE_ASM_FLAGS are not getting inside the .asm files when compiled using armasm.
I'm trying this using the nightly build in which the .asm compilation is fixed for the armasm assembler. (#24134)
The new issue I'm facing is the CMAKE_ASM_FLAGS are not getting inside the .asm files. Does this need to be fixed in the CMake source code?3.26.0https://gitlab.kitware.com/cmake/cmake/-/issues/24289VS: ASM_MASM not adding target_compile_options() to the ml.exe command2024-01-09T12:00:56-05:00dr vengyVS: ASM_MASM not adding target_compile_options() to the ml.exe commandRan into this issue from [StackOverflow](https://stackoverflow.com/questions/75024972/cmake-asm-masm-language-not-adding-target-compile-options-to-the-masm-ml-exe-c)
when trying to assemble a MASM project using cmake version 3.24.3, the ...Ran into this issue from [StackOverflow](https://stackoverflow.com/questions/75024972/cmake-asm-masm-language-not-adding-target-compile-options-to-the-masm-ml-exe-c)
when trying to assemble a MASM project using cmake version 3.24.3, the `target_compile_options()` below
```
if(WIN32)
target_compile_options(HelloWorld
PUBLIC
/DBUILD_HelloWorld
/FlHelloWorld.lst
)
target_link_options(HelloWorld
PUBLIC
/SUBSYSTEM:Console,6.01
/SAFESEH:NO
)
...
```
are not added to the MASM command
` [Build:x86] ml.exe /c /nologo /Zi /Fo"HelloWorld.dir\Debug\CodeBaseEND.obj" /D"CMAKE_INTDIR="Debug"" ...`
However, during the linking phase, the `target_link_options()` are added
` [Build:x86] C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86\link.exe /ERRORREPORT:QUEUE ... /SAFESEH:NO /SUBSYSTEM:Console,6.01`
The root `CMakeLists.txt` file has these languages defined
project(HelloWorld VERSION 1.0.0 LANGUAGES C CXX ASM_MASM)
**Any ideas why the compile options are omitted or where the fix might be?**
Thanks.3.26.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/24249ASM_MASM: Missing support for MSVC_DEBUG_INFORMATION_FORMAT2022-12-16T08:55:27-05:00stl@microsoft.comASM_MASM: Missing support for MSVC_DEBUG_INFORMATION_FORMATRepros with CMake 3.25.0 shipping in VS 2022 17.5 Preview 2.
In our project ([MSVC's STL](https://github.com/microsoft/STL)), we have ASM_MASM sources. When I tried to increase our minimum required version of CMake, it failed with:
```...Repros with CMake 3.25.0 shipping in VS 2022 17.5 Preview 2.
In our project ([MSVC's STL](https://github.com/microsoft/STL)), we have ASM_MASM sources. When I tried to increase our minimum required version of CMake, it failed with:
```
CMake Error in CMakeLists.txt:
MSVC_DEBUG_INFORMATION_FORMAT value 'ProgramDatabase' not known for this
ASM_MASM compiler.
```
This is related to this new feature mentioned in the [CMake 3.25 release notes](https://cmake.org/cmake/help/latest/release/3.25.html):
> The [`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`](https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html#variable:CMAKE_MSVC_DEBUG_INFORMATION_FORMAT) variable and [`MSVC_DEBUG_INFORMATION_FORMAT`](https://cmake.org/cmake/help/latest/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.html#prop_tgt:MSVC_DEBUG_INFORMATION_FORMAT) target property were introduced to select the debug information format for compilers targeting the MSVC ABI. See policy [`CMP0141`](https://cmake.org/cmake/help/latest/policy/CMP0141.html#policy:CMP0141).
As the example below demonstrates, we can work around this by setting the `CMP0141` policy to `OLD`. However, I believe that this workaround should not be necessary, and that this is a bug in CMake - it appears that its internal machinery wasn't taught how to send debug info options to MASM.
While I am not a MASM expert, [MASM documentation](https://learn.microsoft.com/en-us/cpp/assembler/masm/ml-and-ml64-command-line-reference?view=msvc-170) says that `/Zi` "Generates CodeView information in object file.", and comments in MSVC's STL note that (somewhat confusingly) this is equivalent to what `/Z7` does for the `cl.exe` compiler - so `Embedded` in CMake's terminology should be translated to `/Zi` for MASM.
As linked from the release notes, CMake's documentation for [`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`](https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html#variable:CMAKE_MSVC_DEBUG_INFORMATION_FORMAT) says:
> If this variable is not set, the `MSVC_DEBUG_INFORMATION_FORMAT` target property will not be set automatically. If that property is not set, CMake selects a debug information format using the default value `$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>`, if supported by the compiler, and otherwise `$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>`.
If I understand this correctly, because MASM doesn't support `ProgramDatabase`, CMake should fall back to `Embedded` instead of emitting an error that it doesn't know what to do.
```
C:\Temp\REPRO>"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\Build\vcvars64.bat"
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.5.0-pre.2.0
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
C:\Temp\REPRO>cmake --version
cmake version 3.25.0-msvc1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
C:\Temp\REPRO>type CMakeLists.txt
```
```cmake
cmake_minimum_required(VERSION 3.25)
if(DEFINED OVERRIDE_CMP0141)
cmake_policy(SET CMP0141 ${OVERRIDE_CMP0141})
endif()
project(meow_project LANGUAGES CXX ASM_MASM)
set(SOURCES
${CMAKE_CURRENT_LIST_DIR}/meow.cpp
${CMAKE_CURRENT_LIST_DIR}/square.asm
)
add_executable(meow ${SOURCES})
```
```
C:\Temp\REPRO>type meow.cpp
```
```cpp
#include <cstdio>
extern "C" int square(int x);
int main() {
std::printf("\nHello, CMake world!\n");
std::printf("square(7): %d\n", square(7));
}
```
```
C:\Temp\REPRO>type square.asm
PUBLIC square
_TEXT SEGMENT
square PROC
imul ecx, ecx
mov eax, ecx
ret 0
square ENDP
_TEXT ENDS
END
C:\Temp\REPRO>cmake -G Ninja -S . -B out && ninja -C out && out\meow.exe
-- The CXX compiler identification is MSVC 19.35.32124.0
-- The ASM_MASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.35.32124/bin/Hostx64/x64/ml64.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.35.32124/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error in CMakeLists.txt:
MSVC_DEBUG_INFORMATION_FORMAT value 'ProgramDatabase' not known for this
ASM_MASM compiler.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
C:\Temp\REPRO>cmake -G Ninja -S . -B out -DOVERRIDE_CMP0141=OLD && ninja -C out && out\meow.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Temp/REPRO/out
ninja: Entering directory `out'
[1/3] Building ASM_MASM object CMakeFiles\meow.dir\square.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32124.0
Copyright (C) Microsoft Corporation. All rights reserved.
Assembling: C:\Temp\REPRO\square.asm
[3/3] Linking CXX executable meow.exe
Hello, CMake world!
square(7): 49
```
Note: This seems to be similar to an old issue https://gitlab.kitware.com/cmake/cmake/-/issues/19453 but it is definitely not a duplicate of that issue.3.25.2Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/24134The asm files are not getting compiled when CMAKE_ASM_COMPILER is set to armasm2023-01-10T06:51:24-05:00Randeep KumarThe asm files are not getting compiled when CMAKE_ASM_COMPILER is set to armasmDoes CMake supports armasm compiler? The asm files are not getting compiled when CMAKE_ASM_COMPILER is set to armasm.Does CMake supports armasm compiler? The asm files are not getting compiled when CMAKE_ASM_COMPILER is set to armasm.3.26.0https://gitlab.kitware.com/cmake/cmake/-/issues/23537MSVC assembler shows "Assembling" messages that should be suppressed2023-02-10T10:49:55-05:00stl@microsoft.comMSVC assembler shows "Assembling" messages that should be suppressedAfter adding an `.asm` file to our repo, the build output is interrupted by "Assembling" messages being printed by MSVC's assembler (`ml64.exe` for x64, `ml.exe` for x86). We're passing `/nologo` to suppress the copyright banner, but tha...After adding an `.asm` file to our repo, the build output is interrupted by "Assembling" messages being printed by MSVC's assembler (`ml64.exe` for x64, `ml.exe` for x86). We're passing `/nologo` to suppress the copyright banner, but that doesn't suppress this message. Example:
```
D:\GitHub\STL>cmake -G Ninja -S . -B out\build\x64
-- The CXX compiler identification is MSVC 19.33.31424.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.33.31424/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM_MASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.33.31424/bin/Hostx64/x64/ml64.exe
-- Searching for VS clang-format
-- Searching for VS clang-format - found
-- Boost.Math: standalone mode ON
-- Found Python: C:/Users/stl/AppData/Local/Programs/Python/Python310/python.exe (found suitable version "3.10.4", minimum required is "3.9") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: D:/GitHub/STL/out/build/x64
D:\GitHub\STL>ninja -C out\build\x64
ninja: Entering directory `out\build\x64'
[108/984] Building ASM_MASM object stl\CMakeFiles\msvcp_implib_objects.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[244/984] Building ASM_MASM object stl\CMakeFiles\msvcpd_implib_objects.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[260/984] Building ASM_MASM object stl\CMakeFiles\libcpmt.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[404/984] Building ASM_MASM object stl\CMakeFiles\libcpmt1.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[541/984] Building ASM_MASM object stl\CMakeFiles\libcpmtd.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[682/984] Building ASM_MASM object stl\CMakeFiles\libcpmtd1.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[828/984] Building ASM_MASM object stl\CMakeFiles\libcpmtd0.dir\src\alias.asm.obj
Assembling: D:\GitHub\STL\stl\src\alias.asm
[984/984] Linking CXX static library out\lib\amd64\libcpmtd0.lib
```
This is similar to https://gitlab.kitware.com/cmake/cmake/-/issues/21422 which was fixed by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5492 . Could CMake be enhanced to suppress this message when invoking the assembler?https://gitlab.kitware.com/cmake/cmake/-/issues/22341CMake 3.21.0-rc1 broke YASM support2021-06-28T09:19:12-04:00Gregor JasnyCMake 3.21.0-rc1 broke YASM supportThe [nasm_add_deps topic](!5868) introduced generation of GCC-compatible depfiles by the NASM assembler. Unfortunately it closed the door for YASM assembler support because yasm does not support the `-MD` and `-MT` arguments.
The follow...The [nasm_add_deps topic](!5868) introduced generation of GCC-compatible depfiles by the NASM assembler. Unfortunately it closed the door for YASM assembler support because yasm does not support the `-MD` and `-MT` arguments.
The following testcase reproduces the problem:
```cmake
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
project(testcase NONE)
find_program(NASM_EXECUTABLE yasm)
set(CMAKE_ASM_NASM_COMPILER ${NASM_EXECUTABLE})
enable_language(ASM_NASM)
add_library(foo foo.asm)
```
Building results in an error:
```
ninja -v
[1/2] /opt/homebrew/bin/yasm -MD CMakeFiles/foo.dir/foo.asm.o.d -MT CMakeFiles/foo.dir/foo.asm.o -f macho -o CMakeFiles/foo.dir/foo.asm.o /Users/gregorj/src/cmake-issue-yarn/foo.asm
yasm: warning: can open only one input file, only the last file will be processed
yasm: warning: can open only one input file, only the last file will be processed
CMakeFiles/foo.dir/foo.asm.o: /Users/gregorj/src/cmake-issue-yarn/foo.asm
[2/2] : && /usr/bin/ar cr libfoo.a CMakeFiles/foo.dir/foo.asm.o && /usr/bin/ranlib libfoo.a && :
FAILED: libfoo.a
: && /usr/bin/ar cr libfoo.a CMakeFiles/foo.dir/foo.asm.o && /usr/bin/ranlib libfoo.a && :
ar: CMakeFiles/foo.dir/foo.asm.o: No such file or directory
ninja: build stopped: subcommand failed.
```
Thanks,
Gregor3.21.0Gregor JasnyGregor Jasnyhttps://gitlab.kitware.com/cmake/cmake/-/issues/21553ASM_NASM: CMake 3.19.1 adds unsupported '-arch x86_64' on macOS2020-12-07T10:28:25-05:00fpliuASM_NASM: CMake 3.19.1 adds unsupported '-arch x86_64' on macOS[https://github.com/libjpeg-turbo/libjpeg-turbo/issues/473](https://github.com/libjpeg-turbo/libjpeg-turbo/issues/473)[https://github.com/libjpeg-turbo/libjpeg-turbo/issues/473](https://github.com/libjpeg-turbo/libjpeg-turbo/issues/473)3.19.2Raul Tambreraul@tambre.eeRaul Tambreraul@tambre.eehttps://gitlab.kitware.com/cmake/cmake/-/issues/21376QNX: Preprocessing ASM .S source files2020-11-20T11:48:50-05:00Valentin DinitaQNX: Preprocessing ASM .S source filesStarting with CMake 3.19.0-rc1, a new flag was added to the QCC compiler, "-x c", when the LANGUAGE property for a source file was set to C. Before that, the source file was sent to the right compiler without any additional flag that mig...Starting with CMake 3.19.0-rc1, a new flag was added to the QCC compiler, "-x c", when the LANGUAGE property for a source file was set to C. Before that, the source file was sent to the right compiler without any additional flag that might be caused by the LANGUAGE property.
The .S source files (e.g. in libjpeg-turbo) are C-ASM source code that has to be compiled with the QNX C compiler. The compiler knows how to treat them by extension.
The problem here is the newly added "-x" compile flag. "-x c" tells the compiler to treat the source file as pure C code, and it fails. If we change the LANGUAGE property of the source file to any ASM variant, then the file will be sent to the assembler instead of the QCC compiler, and that fails too.
So, we have C-ASM code, two languages, that has to be compiled with QNX-C compiler (QCC), but not marked as pure-C code with the "-x c". CMake 3.18.0 works just fine.https://gitlab.kitware.com/cmake/cmake/-/issues/20780GNU: Incorrect defines flag for 'as' tool2020-06-02T06:39:52-04:00Brad KingGNU: Incorrect defines flag for 'as' toolOur `RunCMake.BuildDepends` test (in `master`) fails with the Ninja Multi-Config generator when testing with the GNU compiler, which activates the `CMake_TEST_BuildDepends_GNU_AS` part of the test.
See further discussion in https://gitl...Our `RunCMake.BuildDepends` test (in `master`) fails with the Ninja Multi-Config generator when testing with the GNU compiler, which activates the `CMake_TEST_BuildDepends_GNU_AS` part of the test.
See further discussion in https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4832#note_769837.3.18.0Kyle EdwardsKyle Edwardshttps://gitlab.kitware.com/cmake/cmake/-/issues/20771CMAKE_OSX_SYSROOT and CMAKE_OSX_ARCHITECTURES don't work for assembly2020-12-04T09:07:12-05:00David BenjaminCMAKE_OSX_SYSROOT and CMAKE_OSX_ARCHITECTURES don't work for assemblyThe `CMAKE_OSX_SYSROOT` and `CMAKE_OSX_ARCHITECTURES` settings aren't propagated to assembly files, like they are for C and C++, when building for Apple platforms. Here's a small repro case:
```
$ cat CMakeLists.txt
cmake_minimum_requi...The `CMAKE_OSX_SYSROOT` and `CMAKE_OSX_ARCHITECTURES` settings aren't propagated to assembly files, like they are for C and C++, when building for Apple platforms. Here's a small repro case:
```
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(test)
enable_language(ASM)
if(WORKAROUND)
if(CMAKE_OSX_SYSROOT)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -isysroot \"${CMAKE_OSX_SYSROOT}\"")
endif()
foreach(arch ${CMAKE_OSX_ARCHITECTURES})
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -arch ${arch}")
endforeach()
endif()
add_executable(test main.c return_zero.S)
$ cat main.c
extern int return_zero(void);
int main() {
return return_zero();
}
$ cat return_zero.S
.text
.align 5
.globl _return_zero
_return_zero:
mov x0, 0
ret
$ cmake -B build1 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 && make -C build1
[...]
[ 66%] Building ASM object CMakeFiles/test.dir/return_zero.S.o
[...]/return_zero.S:6:2: error: unknown use of instruction mnemonic without a size suffix
mov x0, 0
^
[...]
$ cmake -B build2 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DWORKAROUND=1 && make -C build2
[...]
[100%] Built target test
```3.19.0https://gitlab.kitware.com/cmake/cmake/-/issues/20236MSVC_RUNTIME_LIBRARY Incompatible with ASM_MASM project2020-02-04T10:41:23-05:00Jonny PatonMSVC_RUNTIME_LIBRARY Incompatible with ASM_MASM projectIf a project contains asm code compiled using ASM_MASM along with cpp code, and you enable policy CMP0091 to modify the MSVC runtime library, the following error occurs:
```
MSVC_RUNTIME_LIBRARY value 'MultiThreadedDebugDLL' not known...If a project contains asm code compiled using ASM_MASM along with cpp code, and you enable policy CMP0091 to modify the MSVC runtime library, the following error occurs:
```
MSVC_RUNTIME_LIBRARY value 'MultiThreadedDebugDLL' not known for this
ASM_MASM compiler.
```
Using Visual studio 2019 (16.4.3) and cmake 3.16.0.
Can be reproduced using a simple CMakeLists like so:
```
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0091 NEW)
project(test C CXX ASM_MASM)
add_library(test_lib test.asm test.cpp)
```3.15.7Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/18575ASM compiler id not found for Clang with CMake 3.13.0-rc32018-11-12T08:16:32-05:00Gregor JasnyASM compiler id not found for Clang with CMake 3.13.0-rc3Hello,
I noticed that CMake 3.13.0-rc3 has broken support for GNU assembly for Android. CMake 3.12.3 works as expected. Testcase:
Content of `CMakeLists.txt`:
```CMake
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(test...Hello,
I noticed that CMake 3.13.0-rc3 has broken support for GNU assembly for Android. CMake 3.12.3 works as expected. Testcase:
Content of `CMakeLists.txt`:
```CMake
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(testcase)
enable_language(ASM)
add_library(foo STATIC foo.S)
```
Content of `foo.S`
```
.arm
```
Configure with: `cmake -GNinja -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/opt/android-ndk-r16b -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_SYSTEM_VERSION=19 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang ..`
Resulting compilation line with CMake 3.12: `/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7-none-linux-androideabi --sysroot=/opt/android-ndk-r16b/sysroot -g -fPIC -MD -MT CMakeFiles/foo.dir/foo.S.o -MF CMakeFiles/foo.dir/foo.S.o.d -o CMakeFiles/foo.dir/foo.S.o -c ../foo.S`
Faulty line with 3.13rc: `/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -o CMakeFiles/foo.dir/foo.S.o -c ../foo.S`
Thanks,
Gregor3.13.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/18406Full path to ASM sometimes not correctly determined2018-10-03T13:02:12-04:00Raul LaasnerFull path to ASM sometimes not correctly determinedAs an example, consider the following input:
```
# CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(test LANGUAGES Fortran)
enable_language(ASM)
add_executable(main main.f90)
# main.f90
end
```
Configuring with `-DCMAKE_C_COM...As an example, consider the following input:
```
# CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(test LANGUAGES Fortran)
enable_language(ASM)
add_executable(main main.f90)
# main.f90
end
```
Configuring with `-DCMAKE_C_COMPILER=gcc` results in
```
-- The Fortran compiler identification is GNU 8.2.1
-- Check for working Fortran compiler: /bin/f95
-- Check for working Fortran compiler: /bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /bin/f95 supports Fortran 90
-- Checking whether /bin/f95 supports Fortran 90 -- yes
-- The ASM compiler identification is GNU
-- Found assembler: gcc
CMake Error at CMakeLists.txt:8 (enable_language):
The CMAKE_ASM_COMPILER:
gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
```
even though `gcc` is in the PATH. I'm opening this issue following !2418.3.13.0https://gitlab.kitware.com/cmake/cmake/-/issues/17510MSVC as ASM gets confused if Cygwin ld.exe is in the PATH2017-11-30T07:58:17-05:00Mario EmmenlauerMSVC as ASM gets confused if Cygwin ld.exe is in the PATHI have a CI system set up that uses Cygwin for a number of automation tasks. Therefore I have Cygwin's bin/ directory at the end of my PATH system-wide. Now when I use official cmake-3.9.6-win64-x64 from a Visual Studio Build Tools x64 C...I have a CI system set up that uses Cygwin for a number of automation tasks. Therefore I have Cygwin's bin/ directory at the end of my PATH system-wide. Now when I use official cmake-3.9.6-win64-x64 from a Visual Studio Build Tools x64 Command Prompt, cmake will find ``ld.exe`` in the PATH and try to use it instead of ``link.exe``. ``ld.exe`` comes from Cygwin binutils and comes in the PATH after ``link.exe``. I think the latter should be prefered. Is there some way how I can change this behavior wihtout the need to physically remove the file ``ld.exe``?3.11.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/17062Policy CM0054 warning from CMakeDetermineASMCompiler.cmake2017-07-14T08:24:32-04:00Robert DaileyPolicy CM0054 warning from CMakeDetermineASMCompiler.cmakeMy environment:
* OS: Windows 10 x64
* CMake version: `v3.9.20170712-g1336a`
* Generator used: Visual Studio 2015
When running CMake GUI where a script invokes `enable_language(ASM_MASM)`, I get the following warning:
```
CMake Warnin...My environment:
* OS: Windows 10 x64
* CMake version: `v3.9.20170712-g1336a`
* Generator used: Visual Studio 2015
When running CMake GUI where a script invokes `enable_language(ASM_MASM)`, I get the following warning:
```
CMake Warning (dev) at E:/Program Files/CMake/share/cmake-3.9/Modules/CMakeDetermineASMCompiler.cmake:106 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
E:/Program Files/CMake/share/cmake-3.9/Modules/CMakeDetermineASM_MASMCompiler.cmake:17 (include)
Core/ThirdParty/boost/boost-cmake/libs/context.cmake:15 (enable_language)
Core/ThirdParty/boost/boost-cmake/CMakeLists.txt:63 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
```
This seems to be coming from one of the internal CMake modules and I have no apparent control over it. Is this a bug? My minimum required is set to:
cmake_minimum_required( VERSION 3.8.0 )Ben BoeckelBen Boeckelhttps://gitlab.kitware.com/cmake/cmake/-/issues/16535CMAKE_ASM_COMPILER_TARGET not set on Android after enable_language(ASM) with ...2017-05-04T16:23:52-04:00Florent CastelliCMAKE_ASM_COMPILER_TARGET not set on Android after enable_language(ASM) with ClangCompiling some ASM files, I get the following command line generated:
`/home/travis/build/Orphis/boost-cmake/android-ndk-r12b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --sysroot=/home/travis/build/Orphis/boost-cmake/android-ndk-r...Compiling some ASM files, I get the following command line generated:
`/home/travis/build/Orphis/boost-cmake/android-ndk-r12b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --sysroot=/home/travis/build/Orphis/boost-cmake/android-ndk-r12b/platforms/android-24/arch-arm64 -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_EXPORT -DBOOST_CONTEXT_SOURCE=1 -isystem ../boost/boost_1_63_0 -g -fPIC -w -MD -MT CMakeFiles/Boost_context.dir/libs/context/jump_combined.S.o -MF CMakeFiles/Boost_context.dir/libs/context/jump_combined.S.o.d -o CMakeFiles/Boost_context.dir/libs/context/jump_combined.S.o -c /home/travis/build/Orphis/boost-cmake/libs/context/jump_combined.S`
This will build the file for the HOST architecture as it is missing a flag like "--target=armv7-none-linux-androideabi" flag (for compiling for ARMv7 for example).
When I manually set it (for example to CMAKE_CXX_COMPILER_TARGET), I get the file properly compiled for the intended architecture.
I'll try to investigate a fix, but I'm sure you can come up with a fix pretty quickly :)https://gitlab.kitware.com/cmake/cmake/-/issues/16469Problem using NASM on Visual Studio target (CMake v3.7)2019-03-05T06:32:31-05:00Robert BielikProblem using NASM on Visual Studio target (CMake v3.7)I'm adding NASM assembly files with:
```
enable_language(ASM_NASM)
...
add_library(test STATIC rdrand-x86_64.asm)
```
The NASM assembler is found, but the target generates the following vcxproj entries:
```
<ItemGroup>
<None Incl...I'm adding NASM assembly files with:
```
enable_language(ASM_NASM)
...
add_library(test STATIC rdrand-x86_64.asm)
```
The NASM assembler is found, but the target generates the following vcxproj entries:
```
<ItemGroup>
<None Include="....\test\rdrand-x86_64.asm" />
</ItemGroup>
```
Note the **None** element, which just includes the asm file into the test target, but nothing is compiled.https://gitlab.kitware.com/cmake/cmake/-/issues/14710Wrong value in VS .vcxproj project file2018-12-07T09:58:07-05:00Kitware RobotWrong value in VS .vcxproj project fileThis issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=14710). Further discussion may take place here.
---
Same for Visual Studio 10/11/12.
Set additional properties for asm files ...This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=14710). Further discussion may take place here.
---
Same for Visual Studio 10/11/12.
Set additional properties for asm files by
```cmake
set_source_files_properties(${SOURCE_ASMS} PROPERTIES COMPILE_FLAGS /W2)
```
CMake produce .vcxproj with wrong string
```
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level2</WarningLevel>
```
that fail to compile with error
```
error MSB3693: Unable to execute Xaml task. The value "Level2" specified for task parameter "WarningLevel" is not valid.
```
correct format is
```
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">2</WarningLevel>
```
https://gitlab.kitware.com/cmake/cmake/-/issues/12919Wrong include path passed to nasm2018-10-19T10:25:55-04:00Kitware RobotWrong include path passed to nasmThis issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=12919). Further discussion may take place here.
---
When ASM files are using `%include`, current CMake configuration for nasm is...This issue was created automatically from an original [Mantis Issue](https://cmake.org/Bug/view.php?id=12919). Further discussion may take place here.
---
When ASM files are using `%include`, current CMake configuration for nasm is wrong and we got "Unable to open include file ...".
That's because nasm seems to need a trailing slash/backslash in path after a `-I`