MADEAPPS / newton-dynamics

Newton Dynamics is an integrated solution for real time simulation of physics environments.
http://www.newtondynamics.com
Other
952 stars 182 forks source link

LLVM-Clang on Windows: Cannot specify include directories for target "dMath" #253

Open jonesmz opened 3 years ago

jonesmz commented 3 years ago

CMake Error at 3rdparty/newton-dynamics/sdk/dMath/CMakeLists.txt:37 (target_include_directories): Cannot specify include directories for target "dMath" which is not built by this project.

This is caused by this github action configuration

name: Windows

on:
  pull_request:
  push:
  release:
    types: published

jobs:
  build:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2
      with:
    fetch-depth: 1
        submodules: recursive

    - uses: egor-tensin/setup-clang@v1
      if: ${{ matrix.compiler == 'clang' }}

    - uses: ashutoshvarma/setup-ninja@v1.1
      if: ${{ matrix.compiler == 'clang' }}

    - name: Configure (Clang)
      env:
    CC:  C:\Program Files\LLVM\bin\cc.exe
        CXX: C:\Program Files\LLVM\bin\c++.exe
      run: |
    cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -GNinja

Which is because of this cmake configuration code in sdk/dMath/CMakeLists.txt

if (UNIX OR MINGW)
        if(NEWTON_BUILD_SHARED_LIBS)
           add_library(${projectName} SHARED ${CPP_SOURCE})
        else(NEWTON_BUILD_SHARED_LIBS)
           add_library(${projectName} STATIC ${CPP_SOURCE})
        endif(NEWTON_BUILD_SHARED_LIBS)
endif (UNIX OR MINGW)

I can't think of any reason why if(UNIX OR MINGW) should be here. MSVC supports static and dynamic libraries the same as Unix-like environments.

JulioJerez commented 3 years ago

this is in 3.14 can you fix it and submit a patch or post het the changes? also can you try 4.00? I think those issues had been addressed but other users on that build system,

jonesmz commented 3 years ago

also can you try 4.00? I think those issues had been addressed but other users on that build system,

I'm not going to try 4.0 unless there is a tagged release for it, and that tagged release does not contain the 3.14 folder.