diff --git a/dtmerge/CMakeLists.txt b/dtmerge/CMakeLists.txt index ef73e92..4cb86ce 100644 --- a/dtmerge/CMakeLists.txt +++ b/dtmerge/CMakeLists.txt @@ -5,7 +5,7 @@ include(GNUInstallDirs) #set project name project(dtmerge) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) if (CMAKE_COMPILER_IS_GNUCC) add_definitions (-ffunction-sections) diff --git a/eeptools/CMakeLists.txt b/eeptools/CMakeLists.txt index 3438255..90fc284 100644 --- a/eeptools/CMakeLists.txt +++ b/eeptools/CMakeLists.txt @@ -5,7 +5,7 @@ include(GNUInstallDirs) #set project name project(eeptools) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) if (CMAKE_COMPILER_IS_GNUCC) add_definitions (-ffunction-sections) diff --git a/pinctrl/CMakeLists.txt b/pinctrl/CMakeLists.txt index 23cccd9..48b301b 100644 --- a/pinctrl/CMakeLists.txt +++ b/pinctrl/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.10...3.27) include(GNUInstallDirs) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) #set project name project(pinctrl) diff --git a/piolib/CMakeLists.txt b/piolib/CMakeLists.txt index 9e98d9b..384484d 100644 --- a/piolib/CMakeLists.txt +++ b/piolib/CMakeLists.txt @@ -9,7 +9,7 @@ project(piolib) add_compile_definitions(LIBRARY_BUILD=1) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) if (CMAKE_COMPILER_IS_GNUCC) add_definitions (-ffunction-sections) diff --git a/piolib/examples/CMakeLists.txt b/piolib/examples/CMakeLists.txt index 57efafa..71ead36 100644 --- a/piolib/examples/CMakeLists.txt +++ b/piolib/examples/CMakeLists.txt @@ -5,7 +5,7 @@ include(GNUInstallDirs) #set project name project(examples) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) if (CMAKE_COMPILER_IS_GNUCC) add_definitions (-ffunction-sections) diff --git a/rpieepromab/CMakeLists.txt b/rpieepromab/CMakeLists.txt index 897039a..f0db17f 100644 --- a/rpieepromab/CMakeLists.txt +++ b/rpieepromab/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.10...3.27) include(GNUInstallDirs) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) # Set project name and version project(rpieepromab VERSION 0.2.2) diff --git a/rpifwcrypto/CMakeLists.txt b/rpifwcrypto/CMakeLists.txt index f23b397..1b25671 100644 --- a/rpifwcrypto/CMakeLists.txt +++ b/rpifwcrypto/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.10...3.27) include(GNUInstallDirs) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +add_compile_options(-Wall -Wextra $<$:-Werror>) # Set project name project(rpifwcrypto) diff --git a/vclog/CMakeLists.txt b/vclog/CMakeLists.txt index 611f9dc..b7e57eb 100644 --- a/vclog/CMakeLists.txt +++ b/vclog/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10...3.27) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pedantic") +add_compile_options(-Wall -Wextra $<$:-Werror> -pedantic) #set project name project(vclog)