1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Configuration - CLang-cl msvc support #101

Update compiler flags and env.bat to work with clang-cl
This commit is contained in:
dpasukhi 2024-10-12 22:52:11 +01:00
parent d16f03b5b5
commit f336684b26
3 changed files with 16 additions and 2 deletions

View File

@ -30,8 +30,14 @@ if (MSVC)
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -fPIC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
if (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
else()
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()

View File

@ -131,6 +131,8 @@ if not "%DevEnvDir%" == "" (
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else if /I "%VCFMT%" == "clang" (
rem clang
) else (
echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
echo one of:
@ -184,6 +186,8 @@ if /I "%VCFMT%" == "vc9" (
set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else if /I "%VCFMT%" == "clang" (
rem clang
) else (
echo Error: wrong VS identifier
exit /B

View File

@ -80,6 +80,8 @@ if not "%DevEnvDir%" == "" (
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else if /I "%VCFMT%" == "clang" (
rem clang
) else (
echo Error: wrong VS identifier
exit /B
@ -118,6 +120,8 @@ if /I "%VCFMT%" == "vc9" (
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else if /I "%VCFMT%" == "clang" (
rem clang
) else (
echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
echo one of: vc10 ^(VS 2010 SP3^), vc11 ^(VS 2012 SP3^), vc12 ^(VS 2013^) or vc14 ^(VS 2015^)