Skip to content

Instantly share code, notes, and snippets.

@dinhvh
Created July 15, 2013 03:56
Show Gist options
  • Save dinhvh/5997404 to your computer and use it in GitHub Desktop.
Save dinhvh/5997404 to your computer and use it in GitHub Desktop.
ctemplate.podspec
Pod::Spec.new do |s|
s.name = 'ctemplate'
s.version = '0.1'
s.source = { :git => 'https://github.com/dinhviethoa/ctemplate' }
s.header_dir = 'ctemplate'
s.source_files = 'src/**/*.{c,h,cc}'
s.exclude_files = 'src/tests/**/*', 'src/windows/**/*'
# s.compiler_flags = '"-I${PODS_ROOT}/ctemplate/src"'
s.public_header_files = '**/template_*.h', '**/per_expand_data.h', '**/str_ref.h'
s.xcconfig = {
# Use GNU C++ standard
'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++0x',
'CLANG_CXX_LIBRARY' => 'libstdc++',
}
def s.pre_install (pod, lib)
Dir.chdir(pod.root) do
toolchain = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
cflags = ""
cxxflags = "#{cflags} -stdlib=libstdc++ -std=gnu++11"
ldflags = "-lstdc++ -stdlib=libstdc++"
`CFLAGS="#{cflags}" CXXFLAGS="#{cxxflags}" CC="#{toolchain}/clang" CXX="#{toolchain}/clang++" LDFLAGS="#{ldflags}" ./configure`
`make src/htmlparser/htmlparser_fsm.h`
`make src/htmlparser/jsparser_fsm.h`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment