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

bundled feature not working on Windows #1411

Open
Local-Trash opened this issue Jun 17, 2024 · 1 comment
Open

bundled feature not working on Windows #1411

Local-Trash opened this issue Jun 17, 2024 · 1 comment

Comments

@Local-Trash
Copy link

When every I compile my project using the bundled feature it fails. This is the error I am given :

error: failed to run custom build command for `sdl2-sys v0.37.0`

Caused by:
  process didn't exit successfully: `C:\Users\...\OneDrive\Desktop\doom\target\debug\build\sdl2-sys-9a6259d1ece5ddc7\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\...\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\sdl2-sys-0.37.0\\SDL" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DCMAKE_CONFIGURATION_TYPES=Release" "-DSDL_SHARED=OFF" "-DSDL_STATIC=ON" "-DSDL_MAIN_HANDLED=ON" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\...\\OneDrive\\Desktop\\doom\\target\\debug\\build\\sdl2-sys-25e2d959ed9f4449\\out" "-DCMAKE_C_FLAGS= -D__FLTUSED__ --target=x86_64-pc-windows-msvc -ffunction-sections -fdata-sections -m64 --target=x86_64-pc-windows-msvc" "-DCMAKE_C_FLAGS_RELEASE= -D__FLTUSED__ --target=x86_64-pc-windows-msvc -ffunction-sections -fdata-sections -m64 --target=x86_64-pc-windows-msvc" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= --target=x86_64-pc-windows-msvc -ffunction-sections -fdata-sections -m64 --target=x86_64-pc-windows-msvc" "-DCMAKE_ASM_FLAGS_RELEASE= --target=x86_64-pc-windows-msvc -ffunction-sections -fdata-sections -m64 --target=x86_64-pc-windows-msvc" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  CMake Error: Could not create named generator Visual Studio 17 2022

  Generators
  * Unix Makefiles               = Generates standard UNIX makefiles.
    Ninja                        = Generates build.ninja files.
    Ninja Multi-Config           = Generates build-<Config>.ninja files.
    CodeBlocks - Ninja           = Generates CodeBlocks project files
                                   (deprecated).
    CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files
                                   (deprecated).
    CodeLite - Ninja             = Generates CodeLite project files
                                   (deprecated).
    CodeLite - Unix Makefiles    = Generates CodeLite project files
                                   (deprecated).
    Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files
                                   (deprecated).
    Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files
                                   (deprecated).
    Kate - Ninja                 = Generates Kate project files (deprecated).
    Kate - Ninja Multi-Config    = Generates Kate project files (deprecated).
    Kate - Unix Makefiles        = Generates Kate project files (deprecated).
    Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files
                                   (deprecated).
    Sublime Text 2 - Unix Makefiles
                                 = Generates Sublime Text 2 project files
                                   (deprecated).

  thread 'main' panicked at C:\Users\...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.50\src\lib.rs:1098:5:

  command did not execute successfully, got: exit code: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I have updated Visual Studio build tools to include the C++ cmake option and I have update cmake.

@tesuji
Copy link
Contributor

tesuji commented Sep 8, 2024

Could you try again v0.36 or a lower version and see if the bundled feature OK?
I think my PR #1393 broke your case.
If that's the case, build.rs might need to be refactored to use CARGO_FEATURE_{feature} instead of #[cfg].

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

No branches or pull requests

2 participants