Closed cloudwebrtc closed 1 year ago
Passing the FLUTTER_TARGET_PLATFORM flag to cmake to link the correct binary library when compiling.
cmake
flutter-elinux will have CMAKE_BUILD_TYPE and FLUTTER_TARGET_BACKEND_TYPE by default, but there is no way to know the architecture of the target app.
CMAKE_BUILD_TYPE
FLUTTER_TARGET_BACKEND_TYPE
$ flutter-elinux run -d elinux-x11 -v --release ... [ +2 ms] executing: [/home/parallels/flutter-webrtc/example/build/elinux/arm64/release/] cmake -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_BACKEND_TYPE=x11 ...
flutter can get target architecture information through FLUTTER_TARGET_PLATFORM.
FLUTTER_TARGET_PLATFORM
$ flutter run -d linux -v --release ... [ +4 ms] executing: [build/linux/arm64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-arm64 ... [ +24 ms] -- Architecture: aarch64, FLUTTER_TARGET_PLATFORM: linux-arm64
Use the FLUTTER_TARGET_PLATFORM flag to select the corresponding binary library. https://github.com/flutter-webrtc/flutter-webrtc/blob/main/linux/CMakeLists.txt#L45-L52
Passing the FLUTTER_TARGET_PLATFORM flag to
cmake
to link the correct binary library when compiling.flutter-elinux will have
CMAKE_BUILD_TYPE
andFLUTTER_TARGET_BACKEND_TYPE
by default, but there is no way to know the architecture of the target app.flutter can get target architecture information through
FLUTTER_TARGET_PLATFORM
.Use the
FLUTTER_TARGET_PLATFORM
flag to select the corresponding binary library. https://github.com/flutter-webrtc/flutter-webrtc/blob/main/linux/CMakeLists.txt#L45-L52