Skip to content

Commit

Permalink
fix: add flags check fail regex pattern (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock authored Apr 1, 2024
1 parent 04dd9d3 commit 795dd8a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmake/Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ function(check_flags_available return_var flags)
set(CMAKE_REQUIRED_FLAGS "${flags}")

# Check if a simple C++ source file compiles with the provided flags
check_cxx_source_compiles("int main() { return 0; }" is_available FAIL_REGEX
D9002) # linker error
check_cxx_source_compiles(
"int main() { return 0; }"
is_available
FAIL_REGEX
D9002
"unused-command-line-argument"
"invalid argument"
"unknown-warning-option") # linker error

# Store the result of flag availability check in the specified variable
set(${return_var}
Expand Down

0 comments on commit 795dd8a

Please sign in to comment.