Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2023-05-22 19:23:07 +08:00
parent e3cfeb7e0b
commit 7ae41c4c9e
1 changed files with 6 additions and 2 deletions

View File

@ -182,7 +182,7 @@ function(setup_project)
string(APPEND CMAKE_C_FLAGS_RELEASE " /clang:-Ofast ")
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} PARENT_SCOPE)
endif()
else()
elseif(NOT (MINGW AND (CMAKE_C_COMPILER_ID STREQUAL "GNU")))
if(NOT ("x${CMAKE_C_FLAGS}" STREQUAL "x"))
string(REPLACE "-w " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
string(REGEX REPLACE "-W[all|extra|error|pedantic] " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
@ -260,7 +260,7 @@ function(setup_project)
string(APPEND CMAKE_CXX_FLAGS_RELEASE " /clang:-Ofast ")
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} PARENT_SCOPE)
endif()
else()
elseif(NOT (MINGW AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))
if(NOT ("x${CMAKE_CXX_FLAGS}" STREQUAL "x"))
string(REPLACE "-w " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REGEX REPLACE "-W[all|extra|error|pedantic] " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
@ -384,6 +384,10 @@ function(setup_qt_stuff)
endfunction()
function(setup_compile_params)
if(MINGW AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
message(WARNING "setup_compile_params: Current toolchain is not supported. Only LLVM-MinGW (https://github.com/mstorsjo/llvm-mingw) has partial support.")
return()
endif()
cmake_parse_arguments(COM_ARGS "SPECTRE;EHCONTGUARD;PERMISSIVE;INTELCET;INTELJCC;CFGUARD" "" "TARGETS" ${ARGN})
if(NOT COM_ARGS_TARGETS)
message(AUTHOR_WARNING "setup_compile_params: You need to specify at least one target for this function!")