Skip to content
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

Cmake warning issue when building windows desktop app #522

Closed
KhaelM opened this issue Mar 25, 2023 · 7 comments
Closed

Cmake warning issue when building windows desktop app #522

KhaelM opened this issue Mar 25, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@KhaelM
Copy link

KhaelM commented Mar 25, 2023

Running or building Windows desktop app after objectbox dependencies importation shows following warnings:

CMake Warning (dev) at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/FetchContent.cmake:1264 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  flutter/ephemeral/.plugin_symlinks/objectbox_flutter_libs/windows/CMakeLists.txt:58 (FetchContent_Declare)
This warning is for project developers.  Use -Wno-dev to suppress it.

Basic info (please complete the following information):

  • ObjectBox version: objectbox: ^2.0.0 | objectbox_flutter_libs: any
  • Flutter/Dart SDK: 3.7.8
  • Null-safety enabled: yes
  • Reproducibility: always
  • OS: Windows 11
  • Device/Emulator: Windows x64

Steps to reproduce

  1. Create new flutter project
  2. Add objectbox: ^2.0.0 | objectbox_flutter_libs: any to pubspec
  3. Run flutter build windows

Expected behavior

code generation without warnings

@KhaelM KhaelM added the bug Something isn't working label Mar 25, 2023
@greenrobot-team greenrobot-team added enhancement New feature or request and removed bug Something isn't working labels Mar 27, 2023
@greenrobot-team
Copy link
Member

Thanks for reporting! As noted this is just a warning about a deprecated CMake feature and should not prevent the build from succeeding. Anyhow, we should look into resolving this.

@greenrobot-team
Copy link
Member

greenrobot-team commented Dec 11, 2023

It looks like this is known for Flutter and they fixed this in their tests and examples.

I was about to do the same, but with Flutter 3.16.2 I can not longer reproduce the error message (e.g. flutter clean and then flutter build windows).

@greenrobot-team
Copy link
Member

greenrobot-team commented Dec 11, 2023

Never mind, can still see it on CI (probably Cmake stuff is cached somewhere flutter clean does not clean).

Edit: turns out I have an old Visual Studio Community 2022 installation that bundles CMake 3.23, but this policy was introduced with 3.24 ("C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-3.23").

@greenrobot-team greenrobot-team added this to the 2.4.0 milestone Dec 11, 2023
@greenrobot-team
Copy link
Member

This also affects Linux builds. So update CMakeLists.txt for both Linux and Windows.

@greenrobot-team
Copy link
Member

A fix for this is planned to ship with the 2.4.0 release.

@khaled-0
Copy link

Hi, I'm using Linux and getting the same issue

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(objectbox-download) is deprecated, call
  FetchContent_MakeAvailable(objectbox-download) instead.  Policy CMP0169 can
  be set to OLD to allow FetchContent_Populate(objectbox-download) to be
  called directly for now, but the ability to call it with declared details
  will be removed completely in a future version.
Call Stack (most recent call first):
  flutter/ephemeral/.plugin_symlinks/objectbox_flutter_libs/linux/CMakeLists.txt:68 (FetchContent_Populate)
This warning is for project developers.  Use -Wno-dev to suppress it.

Heres flutter doc

╰─❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.0, on Fedora Linux 41 (Workstation Edition)
    6.12.5-200.fc41.x86_64, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.96.2)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

@greenrobot-team
Copy link
Member

@khaled-0 Please avoid double posting, it creates unnecessary work for us. Addressed this in #701 instead as it's a similar issue, but different cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants