Skip to content

Commit

Permalink
fix: MSVC error
Browse files Browse the repository at this point in the history
The error message indicates that the Clang compiler does not recognize the `/utf-8` option, which is a Microsoft Visual C++ (MSVC) specific option. To resolve this issue, you need to conditionally add the `/utf-8` flag only when using the MSVC compiler.

Here's how you can modify your `CMakeLists.txt` to conditionally add the `/utf-8` flag:

1. Check if the compiler is MSVC.
2. If it is, add the `/utf-8` flag.
  • Loading branch information
acgetchell committed Aug 24, 2024
1 parent 2dc8945 commit 63785d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ add_definitions(-DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTC

# Easier navigation in an IDE when projects are organized in folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Check if the compiler is MSVC
if (MSVC)
# Add /utf-8 flag to MSVC
add_compile_options(/utf-8)
endif()
3 changes: 1 addition & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ sonar.organization=acgetchell-github
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src,include
sonar.tests=tests
#sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
sonar.cfamily.compile-commands=build/compile_commands.json
sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
#sonar.cfamily.cache.enabled=true
#sonar.cfamily.cache.path=.sonar
sonar.cfamily.threads=2
Expand Down

0 comments on commit 63785d6

Please sign in to comment.