Created
September 20, 2010 16:32
-
-
Save torarnv/588176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "base.h" | |
Base::Base() {} | |
Base::~Base() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
{ | |
public: | |
Base(); | |
virtual ~Base(); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "base.h" | |
namespace { | |
class LocalToTranslationUnit : public Base { | |
public: | |
LocalToTranslationUnit() {} | |
}; | |
} | |
void CLASS() | |
{ | |
LocalToTranslationUnit local; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: compile | |
clean: | |
rm -f *.o *.dylib *.app | |
compile: lib | |
lib: clang-lib gcc-lib | |
clang: clang-lib | |
clang-lib: | |
clang++ -c base.cpp -o base.clang.o -fvisibility=hidden -fvisibility-inlines-hidden | |
clang++ -c derived.cpp -o foo.clang.o -fvisibility=hidden -fvisibility-inlines-hidden -DCLASS=Foo | |
clang++ -c derived.cpp -o bar.clang.o -fvisibility=hidden -fvisibility-inlines-hidden -DCLASS=Bar | |
clang++ -dynamiclib base.clang.o foo.clang.o bar.clang.o -o libfoo.clang.dylib | |
gcc: gcc-lib | |
gcc-lib: | |
g++ -c base.cpp -o base.gcc.o -fvisibility=hidden -fvisibility-inlines-hidden | |
g++ -c derived.cpp -o foo.gcc.o -fvisibility=hidden -fvisibility-inlines-hidden -DCLASS=Foo | |
g++ -c derived.cpp -o bar.gcc.o -fvisibility=hidden -fvisibility-inlines-hidden -DCLASS=Bar | |
g++ -dynamiclib base.gcc.o foo.gcc.o bar.gcc.o -o libfoo.gcc.dylib | |
nm: | |
nm *.o | c++filt | |
nm *.dylib | c++filt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment