Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with clang-cl #1509

Merged
merged 4 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,34 @@ jobs:
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON
cmake --build . --target ALL_BUILD -- /maxcpucount:4

windows_2019_clang_cl:
name: Windows (clang-cl) [Release]
runs-on: windows-2019
env:
COMPILER: clang
BUILD_TYPE: Release
RUN_TESTS: OFF
VCPKG_ROOT: 'C:/dartsim/vcpkg'
VCPKG_BUILD_TAG: v0.1.1
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
shell: cmd
run: |
mkdir -p C:/dartsim
choco install -y wget
wget https://github.com/dartsim/vcpkg-build/releases/download/%VCPKG_BUILD_TAG%/vcpkg-dartsim-dependencies.zip
unzip vcpkg-dartsim-dependencies.zip -d C:/dartsim
- name: Build
shell: cmd
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -Wno-dev ^
-T ClangCl ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON
cmake --build . --target ALL_BUILD
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ if(MSVC)

# Visual Studio enables C++14 support by default
set(msvc_required_version 1920)
if(MSVC_VERSION VERSION_LESS ${msvc_required_version})
if(MSVC_VERSION VERSION_LESS ${msvc_required_version} AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
message(FATAL_ERROR "Visual Studio ${MSVC_VERSION} is detected, but "
"${PROJECT_NAME_UPPERCASE} requires ${msvc_required_version} or greater."
)
Expand Down
2 changes: 1 addition & 1 deletion dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_subdirectory(external)
# Enable multi-threaded compilation.
# We do this here and not in the root folder since the examples and the
# tutorials do not have enough source files to benefit from this.
if(MSVC)
if(MSVC AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()

Expand Down