mirror of
https://github.com/civetweb/civetweb
synced 2025-03-28 21:13:27 +00:00
Apply patch for #1024
https://github.com/civetweb/civetweb/issues/1024#issuecomment-1131456269
This commit is contained in:
parent
6dc8388fe8
commit
afea23abf3
@ -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)
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user