-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Attempting to cross-compile for Windows on a Linux system fails when following the instructions in BUILDING.md #641
Comments
additional oddity I just noticed: My toolchain.cmake set CMAKE_INSTALL_PREFIX to be |
I'll look into it. I think it's possible to use Unix Makefiles on Windows, via MSYS, so your assumption might not be valid. Ideally the build system should detect whether MinGW is being used on a non-Windows platform and set the install prefix accordingly. |
|
MSYS Makefiles are the preferred method, but if I recall, you can still use Unix Makefiles. Please give me a chance to look into the issue so that I can fully understand it before discussing further. |
Sure. I will leave it with this: I tried it on a (very!) clean install of MSYS2 and using Unix Makefiles worked. Note that I didn't use a The result was no error, but the CMake output showed this:
So even on MSYS2, using "Unix Makefiles" uses Unix-type paths, not Windows paths. |
Your observations above are very odd, because the build system will never set The |
The default install prefix when building under MinGW is chosen based on the needs of the official build system, which uses MSYS2 to generate Windows installer packages that install under c:\libjpeg-turbo-gcc[64]. However, attempting to configure the build with that install prefix on a Un*x machine causes a CMake error. Fixes #641
Have you searched the existing issues (both open and closed) in the libjpeg-turbo issue tracker to ensure that this bug report is not a duplicate?
Yes
Does this bug report describe one of the two known and unsolvable issues with the JPEG format?
No, but reading that was quite enlightening.
Clear and concise description of the bug:
Following the instructions in BUILDING.md for building a Windows version of the library on a Linux system results in an error message from CMake, rather than the desired Makefiles.
This appears to be caused by something getting confused about "the resulting code will run on a Windows system" and "the resulting files will be placed on a Windows system", so it tries to generate Makefiles that will install to drive C: on the Linux system. (More details at the bottom.)
Steps to reproduce the bug (using only libjpeg-turbo):
toolchain.cmake
file as specified in BUILDING.mdcmake
command as specified by BUILDING.md to generate the MakefilesImage(s) needed in order to reproduce the bug (if applicable):
n/a
Expected behavior:
I get some Makefiles I can use to run
make
with (the next step from BUILDING.md)Observed behavior:
I get an error:
Platform(s) (compiler version, operating system version, CPU) on which the bug was observed:
libjpeg-turbo release(s), commit(s), or branch(es) in which the bug was observed (always test the tip of the main branch or the latest stable pre-release to verify that the bug hasn't already been fixed):
dc4a93f (current HEAD)
If the bug is a regression, the specific commit that introduced the regression (use
git bisect
to determine this):n/a
Additional information:
I noticed this at the beginning of the CMake output:
What appears to be happening is this:
make install
, it says "okay files go c:/libjpeg-turbo-gcc64/whatever, use that"When I added the following line my
toolchain.cmake
, everything was happy:CMake ran without errors. make ran without errors. I got some DLLs and EXEs and static libraries. (Haven't tested them yet, though. Still more to go before I can do that one.)
Since the current setup doesn't work at all, I would argue that if you're building Unix Makefiles, the "install" directory should probably be a Unix-type path, since it probably means you're cross-compiling a library to link to another cross-compiled library/application (that's what I'm trying to do, anyway.)
The text was updated successfully, but these errors were encountered: