Only set CMAKE_EXECUTABLE_SUFFIX in toolchain if not defined already#22315
Only set CMAKE_EXECUTABLE_SUFFIX in toolchain if not defined already#22315starball5 wants to merge 2 commits intoemscripten-core:mainfrom
Conversation
sbc100
left a comment
There was a problem hiding this comment.
Change LGTM, but can you add a test for this (i.e. update one of the existing cmake tests so that it will fail without this change).
|
Looks like the test-other failures are geniune. |
|
Is that still needed, or should this be closed? |
|
@starball5 would you have time to rebase and add a test? Or should someone else take a look? |
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
|
I tried to pick up this PR but I noticed that However, Its unfortunate that @bradking maybe can you explain this seemingly behavior? |
|
|
|
|
||
| set(CMAKE_EXECUTABLE_SUFFIX ".js") | ||
| if(NOT DEFINED CMAKE_EXECUTABLE_SUFFIX) | ||
| set(CMAKE_EXECUTABLE_SUFFIX ".js") |
There was a problem hiding this comment.
if(NOT DEFINED CMAKE_EXECUTABLE_SUFFIX) may never be true because CMake's Modules/CMakeGenericSystem.cmake always sets a default empty value earlier. Therefore this change may regress the existing default.
Fixes #18860