Skip to content

whisper: remove MSVC warnings pragmas #3090

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented Apr 29, 2025

This pull request removes the MSVC-specific pragmas from whisper and ggml. These are now handled in the CMakeLists.txt files.

danbev added 2 commits April 29, 2025 16:05
This commit removes the MSVC-specific pragmas as these are now handled
in CMakeLists.txt.
This commit removes the MSVC-specific pragmas. These are now handled in
the CMakeLists.txt file.
@peardox
Copy link

peardox commented Apr 30, 2025

A recently merged commit completely breaks build

It appears to be part of this stuff

Try this...
cmake -B build -DBUILD_SHARED_LIBS=ON -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON

CMake Error at ggml/CMakeLists.txt:371 (target_compile_options):

if (MSVC)
    set(MSVC_WARNING_FLAGS
        /wd4005  # Macro redefinition
        /wd4244  # Conversion from one type to another type, possible loss of data
        /wd4267  # Conversion from 'size_t' to a smaller type, possible loss of data
    )
    function(disable_msvc_warnings target_name)
        target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
    endfunction()

    disable_msvc_warnings(ggml-base)
    disable_msvc_warnings(ggml)
    disable_msvc_warnings(ggml-cpu)
endif()

This one did it
55d73a1

danbev added a commit to danbev/whisper.cpp that referenced this pull request Apr 30, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org#3090 (comment)
danbev added a commit to danbev/whisper.cpp that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org#3090 (comment)
danbev added a commit that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: #3090 (comment)
ggerganov pushed a commit to ggml-org/ggml that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org/whisper.cpp#3090 (comment)
ggerganov pushed a commit to ggml-org/ggml that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org/whisper.cpp#3090 (comment)
ggerganov pushed a commit to ggml-org/llama.cpp that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org/whisper.cpp#3090 (comment)
ggerganov pushed a commit to ggml-org/llama.cpp that referenced this pull request May 1, 2025
This commit adds a check to makes sure that the target exists before
trying to add compile options to ignore warnings when using MSVC.

The motivation for this is currently the build is broken depending on
the cmake options provided. With this fix it should be possible to build
even if the targets are not actually available.

Refs: ggml-org/whisper.cpp#3090 (comment)
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

Successfully merging this pull request may close these issues.

2 participants