• Harris Hancock's avatar
    Use target_compile_features to request C++11 · 1d0d1c3b
    Harris Hancock authored
    Projects which use Cap'n Proto require C++11, because they must be able to
    compile our headers. Old gcc defaults to C++98, forcing users to manually
    specify the -std=gnu++11 flag in their CMake projects. CMake 3.1
    introduced the target_compile_features command which removes this
    necessity by automatically communicating the C++ standard level
    requirement to client projects.
    
    Specifically, if target `kj` requires a C++11 feature publicly, then all
    targets which link to `kj` will also require that C++11 feature, and get
    the -std=gnu++11 flag for free. If that target is a library, such as
    `kj-async`, and `kj-async` links publicly to `kj`, the requirement is also
    transitive to all targets which link to `kj-async`.
    
    Note that CMake's default behavior is to request compiler-specific
    extensions, such as those provided by the -std=gnu++11 flag. You must
    specifically opt out of these extensions. I'm not aware of any way to
    propagate this nuance in CMake, but added a check to at least prevent
    users from compiling Cap'n Proto without extensions.
    
    With this change, the c++/samples/CMakeLists.txt will build with MinGW
    with no change beyond requiring a later version of CMake.
    1d0d1c3b
Name
Last commit
Last update
..
compat Loading commit data...
compiler Loading commit data...
testdata Loading commit data...
CMakeLists.txt Loading commit data...
afl-testcase.c++ Loading commit data...
any-test.c++ Loading commit data...
any.c++ Loading commit data...
any.h Loading commit data...
arena.c++ Loading commit data...
arena.h Loading commit data...
blob-test.c++ Loading commit data...
blob.c++ Loading commit data...
blob.h Loading commit data...
bootstrap-test.ekam-rule Loading commit data...
c++.capnp Loading commit data...
c++.capnp.c++ Loading commit data...
c++.capnp.h Loading commit data...
canonicalize-test.c++ Loading commit data...
capability-test.c++ Loading commit data...
capability.c++ Loading commit data...
capability.h Loading commit data...
capnpc.ekam-rule Loading commit data...
common-test.c++ Loading commit data...
common.h Loading commit data...
dynamic-capability.c++ Loading commit data...
dynamic-test.c++ Loading commit data...
dynamic.c++ Loading commit data...
dynamic.h Loading commit data...
encoding-test.c++ Loading commit data...
endian-fallback-test.c++ Loading commit data...
endian-reverse-test.c++ Loading commit data...
endian-test.c++ Loading commit data...
endian.h Loading commit data...
ez-rpc-test.c++ Loading commit data...
ez-rpc.c++ Loading commit data...
ez-rpc.h Loading commit data...
fuzz-test.c++ Loading commit data...
generated-header-support.h Loading commit data...
layout-test.c++ Loading commit data...
layout.c++ Loading commit data...
layout.h Loading commit data...
list.c++ Loading commit data...
list.h Loading commit data...
membrane-test.c++ Loading commit data...
membrane.c++ Loading commit data...
membrane.h Loading commit data...
message-test.c++ Loading commit data...
message.c++ Loading commit data...
message.h Loading commit data...
orphan-test.c++ Loading commit data...
orphan.h Loading commit data...
persistent.capnp Loading commit data...
persistent.capnp.c++ Loading commit data...
persistent.capnp.h Loading commit data...
pointer-helpers.h Loading commit data...
pretty-print.h Loading commit data...
raw-schema.h Loading commit data...
rpc-prelude.h Loading commit data...
rpc-test.c++ Loading commit data...
rpc-twoparty-test.c++ Loading commit data...
rpc-twoparty.c++ Loading commit data...
rpc-twoparty.capnp Loading commit data...
rpc-twoparty.capnp.c++ Loading commit data...
rpc-twoparty.capnp.h Loading commit data...
rpc-twoparty.h Loading commit data...
rpc.c++ Loading commit data...
rpc.capnp Loading commit data...
rpc.capnp.c++ Loading commit data...
rpc.capnp.h Loading commit data...
rpc.h Loading commit data...
schema-lite.h Loading commit data...
schema-loader-test.c++ Loading commit data...
schema-loader.c++ Loading commit data...
schema-loader.h Loading commit data...
schema-parser-test.c++ Loading commit data...
schema-parser.c++ Loading commit data...
schema-parser.h Loading commit data...
schema-test.c++ Loading commit data...
schema.c++ Loading commit data...
schema.capnp Loading commit data...
schema.capnp.c++ Loading commit data...
schema.capnp.h Loading commit data...
schema.h Loading commit data...
serialize-async-test.c++ Loading commit data...
serialize-async.c++ Loading commit data...
serialize-async.h Loading commit data...
serialize-packed-test.c++ Loading commit data...
serialize-packed.c++ Loading commit data...
serialize-packed.h Loading commit data...
serialize-test.c++ Loading commit data...
serialize-text-test.c++ Loading commit data...
serialize-text.c++ Loading commit data...
serialize-text.h Loading commit data...
serialize.c++ Loading commit data...
serialize.h Loading commit data...
stringify-test.c++ Loading commit data...
stringify.c++ Loading commit data...
test-import.capnp Loading commit data...
test-import2.capnp Loading commit data...
test-util.c++ Loading commit data...
test-util.h Loading commit data...
test.capnp Loading commit data...