Skip to content

Ninja error cl D8016 #149

Description

@donarturo11

Steps to reproduce

  1. Run Developer Command Prompt for VS2022 or load vcvars64.bat under cmd.
  2. Type cmake -GNinja -S stk -B stk-build -DBUILD_STATIC=0 -DBUILD_SHARED=1 -DCMAKE_BUILD_TYPE=Release
  3. Type cmake --build stk-build

Expected result: compile
Given result: Command line error D8016: '/clr' and '/EHs' command-line options are incompatible.

Proposed solution:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9af3227..210c73e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,6 @@ SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release"
 "Debug" "RelWithD
 message("Build type: " ${CMAKE_BUILD_TYPE})

 if(MSVC)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /clr")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /DNDEBUG")
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7 /Ob0 /Od /RTC1 /D_I
TERATOR_DEBUG_LEVEL=2 /D_STK_DEBUG_ /D__RTAUDIO_DEBUG__ /D__RTMIDI_DEBUG__")
 else()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions