NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax

Home Page:https://nvidia.github.io/MatX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Configuration error using Ninja Multi-Config.

raplonu opened this issue · comments

Describe the Bug

Trying to configure the project using Ninja Multi-Config generator result in an error.

To Reproduce

Doing the following:

mkdir build && cd build
cmake -G "Ninja Multi-Config" ..

Will result in an error:

CMake Error at CMakeLists.txt:126 (if):
  if given arguments:

    "NOT" "CMAKE_BUILD_TYPE" "OR" "STREQUAL" "Debug"

  Unknown arguments specified

System Details

  • OS: AlmaLinux release 8.4
  • CUDA version: 12.2
  • g++ version: 11.2

Additional Context

The issue comes from the CMakeLists.txt file line 126:

if (NOT CMAKE_BUILD_TYPE OR ${CMAKE_BUILD_TYPE} STREQUAL "Debug")

CMake conditions does not use short-circuit as stated there

Binary logical operators AND and OR, from left to right, without any short-circuit.

CMake being CMake, the issue only appears using Ninja Multi-Config.

Thanks @raplonu . We are submitting a workaround for now. I didn't see any other clean way of doing this in CMake with an OR condition.