Use C++ (not C) warning flags for GTK client (#4395)
Use the opportunity to reduce duplication.
This commit is contained in:
parent
6d495fbf98
commit
e694c3e3a0
|
@ -603,6 +603,12 @@ else()
|
|||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" "$<SEMICOLON>" C_WARNING_FLAGS_GENEX "${C_WARNING_FLAGS}")
|
||||
string(REPLACE ";" "$<SEMICOLON>" CXX_WARNING_FLAGS_GENEX "${CXX_WARNING_FLAGS}")
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:C>:${C_WARNING_FLAGS_GENEX}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS_GENEX}>)
|
||||
|
||||
###
|
||||
|
||||
include(LargeFileSupport)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
project(trcli)
|
||||
|
||||
add_compile_options(${CXX_WARNING_FLAGS})
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
|
||||
|
|
|
@ -4,8 +4,6 @@ if(WITH_SYSTEMD)
|
|||
add_definitions(-DUSE_SYSTEMD)
|
||||
endif()
|
||||
|
||||
add_compile_options(${CXX_WARNING_FLAGS})
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
project(trgtk)
|
||||
|
||||
add_compile_options(${C_WARNING_FLAGS})
|
||||
if(ENABLE_WERROR)
|
||||
add_compile_options($<IF:$<CXX_COMPILER_ID:MSVC>,/WX,-Werror>)
|
||||
endif()
|
||||
|
|
|
@ -89,11 +89,6 @@ set(PROJECT_FILES
|
|||
webseed.cc
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " CXX_WARNING_FLAGS_STR "${CXX_WARNING_FLAGS}")
|
||||
foreach(FILE ${PROJECT_FILES})
|
||||
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS_STR}")
|
||||
endforeach()
|
||||
|
||||
set(THIRD_PARTY_FILES
|
||||
jsonsl.c
|
||||
wildmat.c
|
||||
|
|
|
@ -57,11 +57,6 @@ set(${PROJECT_NAME}_SOURCES
|
|||
WatchDir.cc
|
||||
)
|
||||
|
||||
string(REPLACE ";" " " CXX_WARNING_FLAGS_STR "${CXX_WARNING_FLAGS}")
|
||||
foreach(FILE ${${PROJECT_NAME}_SOURCES})
|
||||
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS_STR}")
|
||||
endforeach()
|
||||
|
||||
if (NOT ENABLE_QT_COM_INTEROP)
|
||||
set_source_files_properties(ComInteropHelper.cc PROPERTIES HEADER_FILE_ONLY ON)
|
||||
endif()
|
||||
|
|
|
@ -73,7 +73,6 @@ target_include_directories(libtransmission-test SYSTEM
|
|||
|
||||
target_compile_options(libtransmission-test
|
||||
PRIVATE
|
||||
${CXX_WARNING_FLAGS}
|
||||
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:-Wno-sign-compare>) # patches welcomed
|
||||
|
||||
target_link_libraries(libtransmission-test
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
project(trutils)
|
||||
|
||||
add_compile_options(${CXX_WARNING_FLAGS})
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue