You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that #319 introduced a variable JAS_STDC_VERSION to allow user set a proper value via -DJAS_STDC_VERSION=<VALUE> when cross compiling. the reason is try_run command can not run when cross compiling.
Actually, we do not need to compile a C source code to get the value of __STDC_VERSION__, we just need to run C Preprocesser like following shell code:
cc -std=c11 -E -dM - < /dev/null | sed -n '/__STDC_VERSION__/p'| cut -d '' -f3
translate above shell code to cmake script is as follows:
the value of __STDC_VERSION__ is determined by -std=, -std= is fixed in CMakeLists.txt, so this value should be calculated by our build system, not by user.
The text was updated successfully, but these errors were encountered:
You cannot assume that JasPer is being built on a Linux/Unix platform. Also, you cannot assume that the compiler has a command-line interface similar to GCC/Clang. Many users of JasPer do not use Linux/Unix and/or GCC/Clang. So, "-std=..." will not have the desired effect in many cases. The same goes for the "-E", "-dM", and such.
I noticed that #319 introduced a variable
JAS_STDC_VERSION
to allow user set a proper value via-DJAS_STDC_VERSION=<VALUE>
when cross compiling. the reason istry_run
command can not run when cross compiling.Actually, we do not need to compile a C source code to get the value of
__STDC_VERSION__
, we just need to run C Preprocesser like following shell code:translate above shell code to cmake script is as follows:
the value of
__STDC_VERSION__
is determined by-std=
,-std=
is fixed inCMakeLists.txt
, so this value should be calculated by our build system, not by user.The text was updated successfully, but these errors were encountered: