Skip to content

Commit

Permalink
Set ANTLR4CPP_STATIC for everything that links against ANTLR (#112)
Browse files Browse the repository at this point in the history
It isn't sufficient to rely on a single
[`add_definitions`](https://github.com/substrait-io/substrait-cpp/blob/cc8d08af7a7ff4b65d0081fc18f9bb243fe85824/src/substrait/textplan/parser/grammar/CMakeLists.txt#L8)
when defining this. Other things which pulls in ANTLR headers _must_
define this as well - if not, we end up with very hard to debug symbol
visibility errors.

Set it as a public compile definition on the target to ensure the
definition propagates.
  • Loading branch information
mortbopet committed Sep 5, 2024
1 parent 9737507 commit bd9fb04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/substrait/textplan/parser/grammar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@ target_include_directories(

target_link_libraries(textplan_grammar antlr4_static)

# Things which link against textplan_grammar (and pull in antlr4 headers) should
# always set 'ANTLR4CPP_STATIC', to avoid declaring things in the antlr4
# headers as dllexport'ed.
target_compile_definitions(textplan_grammar PUBLIC ANTLR4CPP_STATIC)

install(TARGETS textplan_grammar EXPORT SubstraitTargets)

0 comments on commit bd9fb04

Please sign in to comment.