Skip to content

Enabling CMAKE_INTERPROCEDURAL_OPTIMIZATION breaks cross build #11890

@modbw

Description

@modbw

Describe the bug
Enabling CMAKE_INTERPROCEDURAL_OPTIMIZATION in 93e77ba breaks my cross builds from linux to windows.

Some messages from the build

...
x86_64-w64-mingw32/bin/ar: deps/libmd5/CMakeFiles/md5.dir/md5.c.obj: plugin needed to handle lto object
x86_64-w64-mingw32/bin/ranlib: lib/libmd5.a(md5.c.obj): plugin needed to handle lto object
...
x86_64-w64-mingw32/bin/ld: src/CMakeFiles/doxygen.dir/main.cpp.obj: plugin needed to handle lto object
x86_64-w64-mingw32/bin/ld: lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o): in function `main':
mingw-w64-crt/crt/crtexewin.c:66:(.text.startup+0xb4): undefined reference to `WinMain'

It may be a toolchain issue on my side.

To Reproduce
You will need a x86_64 mingw toolchain with some dependencies. So no easy one-liner to reproduce.

Expected behavior
Just build without any issues.

Version
1.15.0

Additional context
Simplest fix would be to make CMAKE_INTERPROCEDURAL_OPTIMIZATION an option (default TRUE) so that it can be set from the outside if causing issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions