edgexfoundry / device-sdk-c

Owner: Device WG
Apache License 2.0
42 stars 42 forks source link

Build system flags for C services in support of Open SFF application #418

Open jpwhitemn opened 2 years ago

jpwhitemn commented 2 years ago

🚀 Feature Request

support / honor relevant compiler and linker env vars passed in per OpenSFF application.

Relevant Package [REQUIRED]

C SDK and C based device services

Description [REQUIRED]

Per Open SFF application:

Build systems for native binaries MUST honor the relevant compiler and linker (environment) variables passed in to them (e.g., CC, CFLAGS, CXX, CXXFLAGS, and LDFLAGS) and pass them to compiler and linker invocations. A build system MAY extend them with additional flags; it MUST NOT simply replace provided values with its own. If no native binaries are being generated, select "not applicable" (N/A). [build_standard_variables] It should be easy to enable special build features like Address Sanitizer (ASAN), or to comply with distribution hardening best practices (e.g., by easily turning on compiler flags to do so).

The build and installation system SHOULD preserve debugging information if they are requested in the relevant flags (e.g., "install -s" is not used). If there is no build or installation system (e.g., typical JavaScript libraries), select "not applicable" (N/A). [build_preserve_debug]

Describe the solution you'd like

If you have a solution in mind, please describe it. Per email response from @iain-anderson As far as the SDK is concerned, the [build_standard_variables] is fine. It also explicitly builds debug / non-debug versions so I think we're okay for [build_preserve_debug] also. Will have to check the services themselves but they shouldn't be a problem to fix if we don't do the right thing yet ### Describe alternatives you've considered Have you considered any alternative solutions or workarounds?
bnevis-i commented 1 year ago

Invalid. We use CMake. CMake has a special flag to enable debug binaries.