* CMakeLists.txt: Add simple support CMAKE_WARNING_AS_ERROR if CMake doesn't
support it.
@@ -19,6 +19,14 @@ PROJECT(APR C)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
+# Add simple support CMAKE_WARNING_AS_ERROR if CMake doesn't
+# support it.
+IF (CMAKE_VERSION VERSION_LESS 3.24)
+ IF(CMAKE_WARNING_AS_ERROR AND MSVC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
+ ENDIF()
+ENDIF()
+
OPTION(APR_MINIMAL_BUILD "Create minimal APR build" OFF)
IF(NOT APR_MINIMAL_BUILD)
FIND_PACKAGE(EXPAT)
