Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Apply patch for civetweb#1024
Browse files Browse the repository at this point in the history
  • Loading branch information
MHU-valantic authored and bel2125 committed May 23, 2022
1 parent 6dc8388 commit afea23a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
cmake_minimum_required (VERSION 3.3.0)
cmake_policy(VERSION 3.2.2)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW)

# Set up the project
project (civetweb)
Expand Down
9 changes: 5 additions & 4 deletions cmake/AddCCompilerFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ function(add_c_compiler_flag FLAG)
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
check_c_compiler_flag(${SANITIZED_FLAG} NO_DIAGNOSTICS_PRODUCED)
if(${NO_DIAGNOSTICS_PRODUCED})
check_c_compiler_flag("${FLAG}" ${SANITIZED_FLAG})
if(${${SANITIZED_FLAG}})
set(${SANITIZED_FLAG} ON PARENT_SCOPE )
set(VARIANT ${ARGV1})
if(ARGV1)
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" VARIANT "${VARIANT}")
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_C_FLAGS${VARIANT} "${CMAKE_C_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
set(CMAKE_C_FLAGS${VARIANT} "${CMAKE_C_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
endfunction()

8 changes: 4 additions & 4 deletions cmake/AddCXXCompilerFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ function(add_cxx_compiler_flag FLAG)
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
check_cxx_compiler_flag(${SANITIZED_FLAG} NO_DIAGNOSTICS_PRODUCED)
if(${NO_DIAGNOSTICS_PRODUCED})
check_cxx_compiler_flag( "${FLAG}" ${SANITIZED_FLAG} )
if(${${SANITIZED_FLAG}})
set(VARIANT ${ARGV1})
if(ARGV1)
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" VARIANT "${VARIANT}")
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
endfunction()

0 comments on commit afea23a

Please sign in to comment.