# Weird warning about yasm assembler not found:

**URL:** <https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039>\
**Category:** Code\
**Tags:** os:macos, gen:ninja\
**Created:** [September 6, 2021, 12:50pm UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039 "2021-09-06T12:50:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![serge](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@serge](https://discourse.cmake.org/u/serge)\
**Post date:** [September 6, 2021, 12:50pm UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039/1 "2021-09-06T12:50:32Z")

</div>

Hello everybody,

Some strange warning. I am setting the following in order to have assembler running properly:

set(CMAKE\_ASM\_COMPILER /usr/local/bin/yasm)  
set(CMAKE\_ASM\_COMPILE\_OBJECT "\<CMAKE\_ASM\_COMPILER\> -f macho64 -m amd64 -o ")

It works fine and processes the assembler files correctly, although during generation I am getting the following messages:

…  
– The ASM compiler identification is YASM  
– Found assembler: /usr/local/bin/yasm  
– Warning: Did not find file Compiler/YASM-ASM  
…

On one hand the ASM compiler is found, on the other hand yasm compiler is not. Also I did not specified anywhere that I am using yasm beside the path above.

Thanks,  
Serge

---

<div class="post-metadata">

**Author:** ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)\
**Post date:** [September 10, 2021, 4:56am UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039/2 "2021-09-10T04:56:46Z")

</div>

The assembler was found without real problems.

For some reasons CMake expects a file in the Module path called `Compiler/${CMAKE_ASM_COMPILER_ID}-ASM.cmake` if you use language ASM without dialects. See [https://gitlab.kitware.com/cmake/cmake/-/blob/v3.21.2/Modules/CMakeASMInformation.cmake#L24-29](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.21.2/Modules/CMakeASMInformation.cmake#L24-29)  
If a dialect is used or for any other language there is no warning, if such files are missing.

You could try to use `ASM_NASM` instead of `ASM` I guess.

@brad.king Is there a reason for this special warning for language ASM only? Or is this just ancient behavior.

---

<div class="post-metadata">

**Author:** ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)\
**Post date:** [September 10, 2021, 3:29pm UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039/3 "2021-09-10T15:29:10Z")

</div>

I don’t know off the top of my head. Please check `git blame`.

---

<div class="post-metadata">

**Author:** ![serge](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@serge](https://discourse.cmake.org/u/serge)\
**Post date:** [September 11, 2021, 11:47am UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039/4 "2021-09-11T11:47:30Z")

</div>

Thanks Joseph,  
can you elaborate about ASM\_NASM, how can I set it properly and have the above behavior, i.e. asssembler instruction will be : /usr/bin/yam -f macho64 -m amd64 -o …

Thanks,  
Serge

---

<div class="post-metadata">

**Author:** ![jtxa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jtxa/32/1535_2.png) [@jtxa](https://discourse.cmake.org/u/jtxa)\
**Post date:** [September 11, 2021, 12:56pm UTC](https://discourse.cmake.org/t/weird-warning-about-yasm-assembler-not-found/4039/5 "2021-09-11T12:56:16Z")

</div>

Never used dialects myself. But it should be as simple as using `ASM_NASM` everywhere instead of `ASM`.

This little makefile seems to work:

```auto
cmake_minimum_required(VERSION 3.10)

project(tryasm LANGUAGES C ASM_NASM)

add_executable(tryasm main.c test.nasm)

```

During configure it prints out:

```auto
-- The ASM_NASM compiler identification is YASM

```

And it compiles the `.nasm` file with yasm.
