cmake : make -Wmissing-prototypes etc. match the Makefile
This commit is contained in:
parent
7ddf185537
commit
b52ce44afd
2 changed files with 11 additions and 2 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue