cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

Support building with platform specific commands #603

Open ghost opened 7 years ago

ghost commented 7 years ago

Corto's build system has become impressively stable and feature-rich supporting osx and linux projects. Several dependencies require platform dependent build flags such as macros or switch for variable size (-m32 or -m64). I propose we specify support for multiple platforms to ensure packages and applications are as portable as possible between build systems. I consider this functionality to be similar to the logic the build system employs to install packaged binaries from "Install" directory.

    "id": "oasys/core/dds/connext/factory",
    "type": "package",
    "value": {
        "description": "Factory for creating creating DDS entities",
        "author": "Alex Hendren",
        "version": "1.0.0",
        "language": "cpp",
        "managed": false,
        "noapi": true,
        "platforms": [
            {
                "linux": {
                    "name" : "linux-x64",
                    "include" : [
                        "$(CORTO_INCLUDE)/unix"
                    ],
                    "dependencies" : [
                        "oasys/core/common",
                        "oasys/core/dds/connext/vendor"
                    ],
                    "CXXFLAGS": ["-DRTI_UNIX -m64"]
                }
            },
            {
                "Darwin": {
                    "name" : "osx",
                    "include" : [
                        "$(CORTO_INCLUDE)/darwin"
                    ],
                    "dependencies" : [
                        "oasys/core/common",
                        "oasys/core/dds/connext/vendor"
                    ],
                    "CXXFLAGS": ["-DRTI_DARWIN"]
                }
            }
        ]
    }
}
SanderMertens commented 7 years ago

The buildsystem design will be changed after mixin support is added to the typesystem (#590). Mixins will allow dynamically adding fields to an object after it has been defined. This allows the buildsystem to split concerns; where right now all C/C++ flags are located in the package object, language specific settings can then be captured in their own mixin type.

After this design has taken place, it would be good to see how this feature can be best designed in. I agree this is useful functionality.