docopt / docopt.cpp

C++11 port of docopt
Boost Software License 1.0
1.05k stars 146 forks source link

Header only #37

Closed rmpowell77 closed 8 years ago

rmpowell77 commented 8 years ago

Changes to make docopt.cpp header only.

A user would define the preprocessor macro DOCOPT_HEADER_ONLY to control this behavior. This cause the cpp file to be included with the header file.

I've moved most of the inline functions out of docopt.cpp to docopt_private.h as I was making them inline to remove them from the symbol table in Header only mode, so I thought it would be best to put them closer to the functions.

I've tested by building with clang on Mac, and I see a small change in the size of the lib (<1 kbyte smaller).

GamePad64 commented 8 years ago

Well, this may require changes to CMakeLists.txt. After the maintainer merges this PR I will write a fix for CMake build.

jaredgrubb commented 8 years ago

Travis seems ok, so I'll merge it.