c - Cross-platform Library -


basically, want seperate common functionality existing projects seperate library project, allow project remain cross-platform when include library.

i should clarify when "cross-platform" i'm concerned compiling multiple cpu architectures (x86/x86_64/arm).

i have few useful functions use across many of software projects. decided bad practice keep copying these source code files between projects, , should create seperate library project them.

i decided static library suit needs better shared library. however, occurred me static library plaform dependent, , including projects cause these projects platform dependent. disadvantage on including source code itself.

two possible solutions occur me:

  1. include static library compiled each platform.

  2. continue include source code.

i have reservations both of above options. option 1 seems overly complex/wasteful. option 2 seems bad practice, it's possible "library" modified per project , become out-of-sync; if library source code stored in same directory other project source code.

i'd grateful suggestions on how overcome problem, or information on how else has overcome problem?

you adopt standard approach of open source project (even if project not open source). there 1 central point 1 can obtain source code, presumably under revision control (subversion, git...). wishes use library should check out source code, compile (a makefile or similar should included), , set. if needs change in library, so, test changes, , send patch can apply change project (or not, depending on opinion on patch).


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -