Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting '-skey=value' #11463

Closed
ghost opened this issue Jun 22, 2020 · 3 comments · Fixed by #11550
Closed

Supporting '-skey=value' #11463

ghost opened this issue Jun 22, 2020 · 3 comments · Fixed by #11550
Assignees

Comments

@ghost
Copy link

ghost commented Jun 22, 2020

There's an issue happening when em++ is run with CMake, that some flags get reduced using the -s option, due to preexisting CMake behavior. For example:

target_compile_options(example PRIVATE -s key1=value -s key2=value)
# Becomes '-s key1=value key2=value

This is documented in the 3.12.4 and up, here. The working around is to use the SHELL syntax, but it causes extra verbosity.

target_compile_options(example PRIVATE "SHELL: -s key1=value -s key2=value")

I'd like to advocate supporting arguments like this:

em++ -skey1=value -skey2=value

I also believe this is related to #5852, which never got resolved.

@sbc100
Copy link
Collaborator

sbc100 commented Jun 22, 2020

Seems like a reasonable request. That duplication feature of cmake seem pretty crazy/risky.

@sbc100 sbc100 self-assigned this Jun 22, 2020
@ghost
Copy link
Author

ghost commented Jun 22, 2020

Thanks! Just to be clear, because I forgot to explicitly say it at first, adding support for the abbreviated version would allow these options to be used normally, like this:

# Doesn't reduce
target_compile_options(example PRIVATE -skey1=val -skey2=val)

Internally, CMake uses std::unordered_set, which is what reduces the options.

If I had to guess, they decided to document the behavior instead of break backwards compatibility by changing it.

@apples
Copy link

apples commented Jul 3, 2020

I am also running into this issue.

Regarding CMake, duplicate arguments can be handled with the SHELL: syntax. This is not ideal, and is an annoying hurdle for newcomers. But at least there is a way to deal with it. Lots of things in CMake are "risky" 😅

I am also running into microsoft/vscode-cmake-tools#1350, which is probably just a bug in CMake Tools since it also occurs when using the SHELL: syntax.

kleisauke added a commit to kleisauke/meson that referenced this issue Oct 30, 2022
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
kleisauke added a commit to kleisauke/meson that referenced this issue Oct 30, 2022
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
eli-schwartz pushed a commit to mesonbuild/meson that referenced this issue Dec 27, 2022
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
nirbheek pushed a commit to mesonbuild/meson that referenced this issue Feb 6, 2023
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
nirbheek pushed a commit to mesonbuild/meson that referenced this issue Feb 6, 2023
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
nirbheek pushed a commit to mesonbuild/meson that referenced this issue Feb 18, 2023
i.e. without a space between the "-s" and option name. See:
emscripten-core/emscripten#11463

This is supported since Emscripten 1.39.19, see:
emscripten-core/emscripten@f45bea2
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 a pull request may close this issue.

2 participants