Skip to content

Commit

Permalink
Merge pull request eclipse-iceoryx#909 from ApexAI/iox-#905-libcxx-bu…
Browse files Browse the repository at this point in the history
…ild-with-clang

iox-eclipse-iceoryx#905 libcxx support for clang
  • Loading branch information
dkroenke authored Aug 25, 2021
2 parents 8e2edeb + 51a8ceb commit 6930b6d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

**Bugfixes:**

- Fix support for libc++ on clang[\#905](https://github.com/eclipse-iceoryx/iceoryx/issues/905)
- Fix warnings for gcc-11.1[\#838](https://github.com/eclipse-iceoryx/iceoryx/issues/838)
- Incremental builds with the build script are broken[\#821](https://github.com/eclipse-iceoryx/iceoryx/issues/821)
- Compile failed because of missing <limits> for GCC 11[\#811](https://github.com/eclipse-iceoryx/iceoryx/issues/811) thanks to @homalozoa
Expand Down
7 changes: 6 additions & 1 deletion cmake/cyclonedds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

set(EXTRA_CMAKE_ARGS)
if(DEFINED CMAKE_CXX_FLAGS)
list(APPEND EXTRA_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
endif()

# ===== Helpers
function(fetch_and_install name)
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/${name}/download)
Expand Down Expand Up @@ -76,7 +81,7 @@ function(fetch_and_install name)
endforeach()
string( REPLACE ";" " " ADDITIONAL_CMAKE_FLAGS "${ADDITIONAL_CMAKE_FLAGS}")

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${TOOLCHAIN_FILE}" "${SOURCE_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${TOOLCHAIN_FILE}" "${EXTRA_CMAKE_ARGS}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
9 changes: 7 additions & 2 deletions cmake/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ if(BUILD_TEST)
set(GTest_DIR ${GTest_DIR} CACHE PATH "" FORCE)
endif()

set(EXTRA_CMAKE_ARGS)
if(DEFINED CMAKE_CXX_FLAGS)
list(APPEND EXTRA_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
endif()

# set download confi, source and build paths
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/googletest/download)
set(SOURCE_DIR ${CMAKE_BINARY_DIR}/dependencies/googletest/src)
Expand All @@ -49,7 +54,7 @@ if(BUILD_TEST)
# Download and unpack googletest at configure time
configure_file(googletest.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt)

execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "${TOOLCHAIN_FILE}" "${DOWNLOAD_CONFIG_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "${COMPILER_FLAGS}" "${TOOLCHAIN_FILE}" "${DOWNLOAD_CONFIG_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${DOWNLOAD_CONFIG_DIR} )
if(result)
Expand All @@ -76,7 +81,7 @@ if(BUILD_TEST)
endif()
endif()

execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${TOOLCHAIN_FILE}" "${SOURCE_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} ${ENABLE_STATIC_DEBUG} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${TOOLCHAIN_FILE}" "${EXTRA_CMAKE_ARGS}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bool popFromFiFoImpl(uint64_t& value)

void popFromFiFo()
{
uint64_t maybeValue;
uint64_t maybeValue{0U};
if (popFromFiFoImpl(maybeValue))
{
globalCounter += maybeValue;
Expand Down
7 changes: 7 additions & 0 deletions tools/iceoryx_build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ BUILD_SHARED="OFF"
TOML_FLAG="ON"
COMPONENTS="iceoryx_posh iceoryx_hoofs iceoryx_introspection iceoryx_binding_c iceoryx_component iceoryx_dds"
TOOLCHAIN_FILE=""
CMAKE_CXX_FLAGS=""

while (( "$#" )); do
case "$1" in
Expand Down Expand Up @@ -174,6 +175,11 @@ while (( "$#" )); do
export CXX=$(which clang++)
shift 1
;;
"libcxx")
echo " [i] Build with libc++ library"
CMAKE_CXX_FLAGS="-stdlib=libc++"
shift 1
;;
"doc")
echo " [i] Build and generate doxygen"
BUILD_DOC="ON"
Expand Down Expand Up @@ -281,6 +287,7 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_SHARED_LIBS=$BUILD_SHARED \
-DSANITIZE=$SANITIZE_FLAG \
-DTEST_WITH_ADDITIONAL_USER=$TEST_ADD_USER $TOOLCHAIN_FILE \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
$WORKSPACE/iceoryx_meta

cmake --build . --target install -- -j$NUM_JOBS
Expand Down

0 comments on commit 6930b6d

Please sign in to comment.