Skip to content

Commit

Permalink
fu c++ flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Paleologue committed Aug 10, 2021
1 parent 583dcd0 commit 9f7c227
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
runs-on: ubuntu-20.04

env:
CXXFLAGS: -std=c++11 -fPIC
CXXFLAGS: -std=gnu++11
CPPFLAGS: -fPIC

steps:
- name: Update APT
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
runs-on: ubuntu-20.04

env:
CXXFLAGS: -std=c++11 -fPIC
CXXFLAGS: -std=gnu++11
CPPFLAGS: -fPIC

steps:
- name: Update APT
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ RUN apt-get update && apt-get install -y apt-utils ca-certificates locales \
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade cmake

ENV CPPFLAGS "-Wall -std=c++11 -fPIC"
ENV CPPFLAGS "-Wall -std=gnu++11 -fPIC"
WORKDIR /opt/workspace
COPY scripts /opt/scripts
2 changes: 1 addition & 1 deletion scripts/build_all.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export CXXFLAGS=" -std=c++11 -fPIC"
export CXXFLAGS=" -std=gnu++11 -fPIC"

cd zlib && bash build.sh && cd ..
cd icu && bash build.sh && cd ..
Expand Down
17 changes: 13 additions & 4 deletions scripts/build_boost.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ function build_and_install()
./bootstrap.sh --with-python-version=3.5 --with-python=$(which python3) --with-icu=${ICU_ROOT} --prefix="${INSTALL_DIR}"
fi

echo "Building Boost with C++ flags: ${CPPFLAGS}"
export GATHERED_FLAGS=""
if [ -n "${CXXFLAGS}" ]; then
export GATHERED_FLAGS="${CXXFLAGS}"
fi
if [ -n "${CPPFLAGS}" ]; then
./b2 -a cxxflags="${CPPFLAGS}"
export GATHERED_FLAGS="${GATHERED_FLAGS} ${CPPFLAGS}"
fi

if [ -n "${GATHERED_FLAGS}" ]; then
echo "Building Boost with C++ flags: ${GATHERED_FLAGS}"
./b2 variant=release link=shared cxxflags="${GATHERED_FLAGS}"
else
./b2 -a
echo "Building Boost with no C++ flag"
./b2 variant=release link=shared
fi

sudo ./b2 install
Expand All @@ -38,7 +47,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}/boost*
sudo rm -rf ${EXTRACT_DIR}/boost*

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_eigen3.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function build_and_install()
sudo make install

cd ..
rm -rf build
sudo rm -rf build
}

git clone ${GIT_URL} ${EXTRACT_DIR} -b ${LIB_VER}
Expand All @@ -31,7 +31,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_icu.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_json-nlohmann.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function build_and_install()
sudo make install

cd ..
rm -rf build
sudo rm -rf build
}

git clone ${GIT_URL} ${EXTRACT_DIR} -b ${LIB_VER}
Expand All @@ -31,7 +31,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_libusb.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_openssl.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function build_and_install()
./config --prefix=${INSTALL_DIR} --openssldir=${INSTALL_DIR}
fi

echo "Building OpenSSL with C++ flags: ${CPPFLAGS}"
echo "Building OpenSSL with C++ flags: ${CPPFLAGS} ${CXXFLAGS}"
make -j4
sudo make install_sw
}
Expand All @@ -27,7 +27,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_sqlite3.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}/sqlite*
sudo rm -rf ${EXTRACT_DIR}/sqlite*

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_tinyxml.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function build_and_install()
sudo make install

cd ..
rm -rf build
sudo rm -rf build
}

git clone ${GIT_URL} ${EXTRACT_DIR} -b ${LIB_VER}
Expand All @@ -31,7 +31,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_zlib.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sudo echo '${LIB_VER}' | sudo tee -a ${INSTALL_DIR}/VERSION
# install on the system for the next tasks
build_and_install
cd ..
rm -rf ${EXTRACT_DIR}
sudo rm -rf ${EXTRACT_DIR}

if [ -x "$(command -v qibuild)" ]; then
echo "------------ Building qitoolchain package ----------------"
Expand Down

0 comments on commit 9f7c227

Please sign in to comment.