Skip to content

Commit 63785d6

Browse files
committed
fix: MSVC error
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.
1 parent 2dc8945 commit 63785d6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cmake/StandardProjectSettings.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ add_definitions(-DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTC
5454

5555
# Easier navigation in an IDE when projects are organized in folders.
5656
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
57+
58+
# Check if the compiler is MSVC
59+
if (MSVC)
60+
# Add /utf-8 flag to MSVC
61+
add_compile_options(/utf-8)
62+
endif()

sonar-project.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ sonar.organization=acgetchell-github
1414
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
1515
sonar.sources=src,include
1616
sonar.tests=tests
17-
#sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
18-
sonar.cfamily.compile-commands=build/compile_commands.json
17+
sonar.cfamily.build-wrapper-output=build_wrapper_output_directory
1918
#sonar.cfamily.cache.enabled=true
2019
#sonar.cfamily.cache.path=.sonar
2120
sonar.cfamily.threads=2

0 commit comments

Comments
 (0)