Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full CMake Integration : Forward properly linker flags, CFLAGS, CXXFLAGS, support statically linked libstdc++ and unit + integration tests support for Corrosion on top of master #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

daminetreg
Copy link

@daminetreg daminetreg commented Sep 6, 2024

🆕 Properly control the rust targets native ffi builds for CXXSTDLIB,CFLAGS,CXXFLAGS

This also manages CMAKE_POSITION_INDEPENDENT_CODE for Rust targets and generally
supports the use case of setting a custom stdlib= and linking it statically
by appropriate flags in CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS.

As for example :

set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -stdlib=libc++ ")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")

set (CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -stdlib=libc++ -static-libstdc++ -static-libgcc /usr/local/share/.tipi/clang/4f846ee/lib/libc++.a /usr/local/sþhare/.tipi/clang/4f846ee/lib/libc++abi.a")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc /usr/local/share/.tipi/clang/4f846ee/lib/libc++.a /usr/local/share/.tipi/clang/4f846ee/lib/libc++abi.a")

Also this adds the changes of #1 but on top of master as I needed fixes from the master branch that has a tad better but still very early install support.

For each target we add a ctest target to run unit tests and we register newly the cargo integration tests as part of the build.

examples and doctests are not supported yet but could be added in a similar fashion later on.

For each target we add a ctest target to run unit tests and we register
newly the cargo integration tests as part of the build.

examples and doctests are not supported yet but could be added in a similar
fashion.

# Conflicts:
#	cmake/CorrosionGenerator.cmake
…FLAGS,CXXFLAGS

This also manages CMAKE_POSITION_INDEPENDENT_CODE for Rust targets and generally
supports the use case of setting a custom stdlib= and linking it statically
by appropriate flags in CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS.

As for example :
```
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -stdlib=libc++ ")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")

set (CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -stdlib=libc++ -static-libstdc++ -static-libgcc /usr/local/share/.tipi/clang/4f846ee/lib/libc++.a /usr/local/sþhare/.tipi/clang/4f846ee/lib/libc++abi.a")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc /usr/local/share/.tipi/clang/4f846ee/lib/libc++.a /usr/local/share/.tipi/clang/4f846ee/lib/libc++abi.a")
```
@daminetreg daminetreg changed the title unit + integration tests support for Corrosion on top of master Full CMake Integration : Forward properly linker flags, CFLAGS, CXXFLAGS, support statically linked libstdc++ and unit + integration tests support for Corrosion on top of master Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant