Refactor generator expressions for CMake
@@ -99,11 +99,12 @@ set_target_properties(${PROJECT_NAME}
target_compile_options(${PROJECT_NAME}
PRIVATE
- $<$<C_COMPILER_ID:Clang>:-Wcast-align
+ # Clang
+ $<$<C_COMPILER_ID:Clang>:
+ -Wcast-align
-Wcast-qual
-Wconversion
-Wexit-time-destructors
- -Wextra-semi-stmt
-Wglobal-constructors
-Wmissing-noreturn
-Wmissing-prototypes
@@ -112,8 +113,13 @@ target_compile_options(${PROJECT_NAME}
-Wshadow
-Wweak-vtables
-Werror
- -Wall>
- $<$<C_COMPILER_ID:GNU>:-Waddress
+ -Wall
+ $<$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,8.0.0>:-Wextra-semi-stmt>
+ >
+
+ # GCC
+ $<$<C_COMPILER_ID:GNU>:
+ -Waddress
-Waggregate-return
-Wformat-nonliteral
-Wformat-security
@@ -129,8 +135,13 @@ target_compile_options(${PROJECT_NAME}
-Wwrite-strings
-Wpointer-arith
-Werror
- -Wall>
- $<$<C_COMPILER_ID:MSVC>:/Wall>
+ -Wall
+ >
+
+ # MSVC
+ $<$<C_COMPILER_ID:MSVC>:
+ /Wall
+ >
)
write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake
