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

cable_add_cxx_compiler_flag_if_supported breaks options that rely on slashes being preserved #15

Open
ekpyron opened this issue Dec 4, 2020 · 3 comments

Comments

@ekpyron
Copy link
Member

ekpyron commented Dec 4, 2020

@axic suggested I mention this here: in the solidity repo we have to deviate from cable's cable_add_cxx_compiler_flag_if_supported, due to the regex in

string(REGEX REPLACE "^-|/" "" name ${FLAG})

Specifically we have eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity") in
https://github.com/ethereum/solidity/blob/0015e8cd847ae81926438e7f8aa90b89ed328e0c/cmake/EthCompilerSettings.cmake#L29
which relies on slashes that are not at the beginning of the option to be left untouched.

We noticed when @axic attempted to re-sync our ancient eth_add_cxx_compiler_flag_if_supported with the current cable_add_cxx_compiler_flag_if_supported from here.

@axic
Copy link
Member

axic commented Mar 20, 2021

Ping @chfast

@chfast
Copy link
Member

chfast commented Mar 21, 2021

I'm not sure where the problem is. The flag is tested as provided, without any modification. The regex replace is only used to have nicer CMake name for the variable (also visible in the output).

If you have a fix for your problem send me a patch.

@chfast
Copy link
Member

chfast commented Mar 24, 2021

I remember now that check_cxx_compiler_flag() can fail if "bad" result variable name is provided (for unknown reason).

I created new version if such wrapper in wasmx/fizzy#770. Please review it or even give it a try in solidity.

There I convert flag name to a proper C identifier so it should also fix this issue.

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

No branches or pull requests

3 participants