Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

port_compiler: auto-select C++ specific link template #617

Merged
merged 1 commit into from Aug 26, 2016
Merged

port_compiler: auto-select C++ specific link template #617

merged 1 commit into from Aug 26, 2016

Conversation

ghost
Copy link

@ghost ghost commented Aug 26, 2016

Even though "$CC foo.o -lstdc++ -o foo.so" works if foo.o was built with
$CXX, depending on the platform and toolchain and C++ standard used, it
may not. In order to ensure this works reliably, we introduce
EXE_LINK_CXX_TEMPLATE and DRV_LINK_CXX_TEMPLATE and auto-select if the
port spec being built consists of at least one C++ source.

Even though "$CC foo.o -lstdc++ -o foo.so" works if foo.o was built with
$CXX, depending on the platform and toolchain and C++ standard used, it
may not. In order to ensure this works reliably, we introduce
EXE_LINK_CXX_TEMPLATE and DRV_LINK_CXX_TEMPLATE and auto-select if the
port spec being built consists of at least one C++ source.
@ghost
Copy link
Author

ghost commented Aug 26, 2016

@laverite, can you verify this fixes dukesoferl/re2#15?

@ghost
Copy link
Author

ghost commented Aug 26, 2016

Alternatively, we could introduce $LINKER and use that instead of $CC in $EXE_LINK_TEMPLATE and $DRV_LINK_TEMPLATE.

@laverite
Copy link

laverite commented Aug 26, 2016

@Tuncer thank you. yeah that fixes dukesoferl/re2#15 for me when I use rebar, but i'm using rebar3 :D.

@ghost
Copy link
Author

ghost commented Aug 26, 2016

@lrascao, can you please review?

@lrascao
Copy link
Contributor

lrascao commented Aug 26, 2016

@Tuncer looks good, merging

@lrascao lrascao merged commit 9b2b023 into rebar:master Aug 26, 2016
@lrascao lrascao mentioned this pull request Aug 26, 2016
@ghost ghost deleted the linkcpp branch August 27, 2016 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants