Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 10, 2026

For some reason setting CMAKE_EXECUTABLE_SUFFIX from the command line does not work, even though settings CMAKE_EXECUTABLE_SUFFIX_<LANG> does work. This seems to be true regardless of what I do in the toolchain file. Its also true for native/host cmake.

i.e. -DCMAKE_EXECUTABLE_SUFFIX=.foo has no effect but -DCMAKE_EXECUTABLE_SUFFIX_C=.foo works.

Replaces: #22315

For some reason setting `CMAKE_EXECUTABLE_SUFFIX` from the command line
does not work, even though settings `CMAKE_EXECUTABLE_SUFFIX_<LANG>`
does work.  This seems to be true regardless of what I do in the
toolchain file.  Its also true for native/host cmake.

i.e. `-DCMAKE_EXECUTABLE_SUFFIX=.foo` has no effect but
`-DCMAKE_EXECUTABLE_SUFFIX_C=.foo` works.

Replaces: emscripten-core#22315
ret = self.run_process(['ctest'], env=env)

def test_cmake_executable_suffix(self):
# Setting CMAKE_EXECUTABLE_SUFFIX for some reason does not work from the command line.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it sound like the test is verifying an emscripten bug, but from your PR description this is the normal CMake behavior?

Suggested change
# Setting CMAKE_EXECUTABLE_SUFFIX for some reason does not work from the command line.
# CMake ignores CMAKE_EXECUTABLE_SUFFIX from the command line.

If it is a CMake bug perhaps link to it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the discussion in #22315 it seems like it not supposed to be set by the user at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, then maybe just remove "for some reason"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants