Skip to content

cmake only works with make as generator #421

@larseggert

Description

@larseggert

Describe the bug

The cmake build setup only seems to work with make as a generator and not, for example, with ninja.

Steps to reproduce the behavior

# mkdir build && cd build && cmake -GNinja ..
-- Source Dir: /Users/lars/Documents/Code/msquic
-- Host System name: Darwin
-- Setting policy 0091
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- System name: Darwin
-- System version: 19.5.0
-- Platform version:
-- Disabling events and logging
-- Disabling session resumption support
-- Disabling 0-RTT support
-- Configuring for OpenSSL
-- Configuring done
-- Generating done
CMake Error:
  Running
   '/usr/local/bin/ninja' '-C' '/Users/lars/Documents/Code/msquic/Debug' '-t' 'cleandead'
  failed with:
   ninja: error: build.ninja:84: bad $-escape (literal $ must be written as $$)
CMake Error:
  Running
   '/usr/local/bin/ninja' '-C' '/Users/lars/Documents/Code/msquic/Debug' '-t' 'recompact'
  failed with:
   ninja: error: build.ninja:84: bad $-escape (literal $ must be written as $$)
CMake Generate step failed.  Build files cannot be regenerated correctly.```

Expected vs actual behavior

Expect the build to work.

Fixes

The error above can be removed by removing the -j$(nproc) part from the add_custom_command that builds openssl. But then the error becomes:

# ninja
ninja: error: 'openssl/lib/libssl.a', needed by 'bin/Release/libmsquic.dylib', missing and no known rule to make it

So there are some additional issues.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions