diff --git a/CMakeLists.txt b/CMakeLists.txt index c0b93564a..6c6fd9fd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -434,8 +434,9 @@ if (LLAMA_ALL_WARNINGS) -Wno-unused-function -Wno-multichar ) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # g++ only + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # clang++ only + set(cxx_flags ${cxx_flags} -Wmissing-prototypes) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # g++ only set(cxx_flags ${cxx_flags} -Wno-format-truncation -Wno-array-bounds) endif() else() diff --git a/examples/train-text-from-scratch/CMakeLists.txt b/examples/train-text-from-scratch/CMakeLists.txt index 4459516d0..1c7040ff6 100644 --- a/examples/train-text-from-scratch/CMakeLists.txt +++ b/examples/train-text-from-scratch/CMakeLists.txt @@ -3,3 +3,11 @@ add_executable(${TARGET} train-text-from-scratch.cpp) install(TARGETS ${TARGET} RUNTIME) target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) target_compile_features(${TARGET} PRIVATE cxx_std_11) + +# TODO(cebtenzzre): remove this once PR #2632 gets merged +if (NOT MSVC) + target_compile_options(${TARGET} PRIVATE -Wno-missing-declarations) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(${TARGET} PRIVATE -Wno-missing-prototypes) +endif()