bincrafters / community

Central repository for issues and recipes
http://bincrafters.readthedocs.io/en/latest/
MIT License
217 stars 36 forks source link

wxwidgets/3.1.5: build failure when cross compiling #1432

Closed gmeeker closed 1 week ago

gmeeker commented 2 years ago

In 3.1.5 wxWidgets started appending the system name to the library file names (only when cross compiling):

    if (CMAKE_CROSSCOMPILING)
        set(cross_target "-${CMAKE_SYSTEM_NAME}")
    endif()

The build fails because conanfile.py doesn't find the correct files. While that could be fixed, this behavior probably breaks Conan compatibility. For example if you cross compile macOS ARM from a macOS Intel machine, the library names would be different than compiling directly on a macOS ARM machine.

This behavior seems intentional so I don't think we can fix it upstream. wxWidgets recently changed the cmake support to match the filenames from configure:

https://github.com/wxWidgets/wxWidgets/pull/2291

And affected file was updated again post 3.1.5, so a separate patch will be required for a future 3.1.6 release:

https://github.com/wxWidgets/wxWidgets/pull/2358

Package and Environment Details (include every applicable attribute)

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

conan profile show default

Configuration for profile default:

[settings]
os=Macos
os_build=Macos
os.version=10.13
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=13.0
compiler.libcxx=libc++
build_type=Release
compiler.cppstd=11
[options]
[conf]
[build_requires]
[env]

conan profile show armv8

Configuration for profile armv8:

[settings]
os=Macos
os_build=Macos
os.version=11.0
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=13.0
compiler.libcxx=libc++
build_type=Release
compiler.cppstd=11
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

conan create . wxwidgets/3.1.5@bincrafters/stable -pr armv8 -pr:b default -b missing

Logs (Include/Attach if Applicable)

Click to expand log ``` -- Build files have been written to: /Users/gmeeker/bincrafters/recipes/wxwidgets/all/test_package/build/913588727f8d8bf04520135e3e981db01271c63b [ 50%] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o [100%] Linking CXX executable bin/test_package ld: library not found for -lwx_osx_cocoau_xrc-3.1 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [bin/test_package] Error 1 make[1]: *** [CMakeFiles/test_package.dir/all] Error 2 make: *** [all] Error 2 ERROR: wxwidgets/3.1.5@bincrafters/stable (test package): Error in build() method, line 12 cmake.build() ConanException: Error 2 while executing cmake --build '/Users/gmeeker/bincrafters/recipes/wxwidgets/all/test_package/build/913588727f8d8bf04520135e3e981db01271c63b' '--' '-j16' ```

Note the library names end in "-Darwin":

wx-config --libs
-L/Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib -pthread /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_osx_cocoau_xrc-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_osx_cocoau_qa-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_baseu_net-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_osx_cocoau_html-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_osx_cocoau_core-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_baseu_xml-3.1-Darwin.a /Users/gmeeker/.conan/data/wxwidgets/3.1.5/bincrafters/stable/package/46d7b5f3a952b9ca844206da63a0a1c473e166a2/lib/libwx_baseu-3.1-Darwin.a -lwx_osx_cocoau_core-3.1-Darwin libjpeg.a libpng16.a libtiffxx.a libtiff.a -ldep_name-NOTFOUND -framework AudioToolbox -framework WebKit -lwx_baseu-3.1-Darwin libexpat.a libz.a -lwxregexu-3.1 -framework CoreFoundation -framework Security -framework Carbon -framework Cocoa -framework IOKit -framework QuartzCore 
Croydon commented 1 week ago

wxwidgets is now in CCI https://conan.io/center/recipes/wxwidgets