diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml index 1a99763fc3..43404a44a8 100644 --- a/.github/workflows/build_osx.yml +++ b/.github/workflows/build_osx.yml @@ -102,7 +102,7 @@ jobs: # INSTALL_RPATH to "@loader_path" on Apple. CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release \ BUILD_BONSAIVIEWER=ON QT_DIR="${QT_DIR}" \ - python3 ./nix/build-all.py -v --diskcleanup --shared ${MAC_INTEL} \ + python3 ./nix/build-all.py -v --diskcleanup --ifcopenshell-shared ${MAC_INTEL} \ | tee build.log - name: Upload Build Logs diff --git a/.github/workflows/build_rocky.yml b/.github/workflows/build_rocky.yml index 7c1343f349..d6c3f50c6d 100644 --- a/.github/workflows/build_rocky.yml +++ b/.github/workflows/build_rocky.yml @@ -80,7 +80,7 @@ jobs: set -o pipefail CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON \ uv run --with aqtinstall ./nix/build-all.py \ - -v --diskcleanup --shared 2>&1 \ + -v --diskcleanup --ifcopenshell-shared 2>&1 \ | tee build.log - name: Upload Build Logs diff --git a/.github/workflows/build_rocky_arm.yml b/.github/workflows/build_rocky_arm.yml index 51eb2f3b31..b805d81436 100644 --- a/.github/workflows/build_rocky_arm.yml +++ b/.github/workflows/build_rocky_arm.yml @@ -92,7 +92,7 @@ jobs: set -o pipefail CXXFLAGS="-O3" CFLAGS="-O3" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON \ uv run --with aqtinstall ./nix/build-all.py \ - -v --diskcleanup --shared 2>&1 \ + -v --diskcleanup --ifcopenshell-shared 2>&1 \ | tee build.log - name: Upload Build Logs diff --git a/nix/build-all.py b/nix/build-all.py index bf0fe3897b..f3697f2f67 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -36,6 +36,8 @@ Available arguments: ``-without-xxx`` - do not build dependency ``xxx`` (e.g. ``--without-swig``) ``-mac-cross-compile-intel`` - cross compile for Intel Mac on Apple Silicon host ``-shared`` - build shared libraries. By default will build static. + ``-ifcopenshell-shared`` - build only IfcOpenShell's own libraries as shared + (dependencies stay static). Redundant if ``-shared`` is also passed. ``-diskcleanup`` - clean up build directories after finishing building dependencies ``-v`` - enable verbose logs @@ -380,6 +382,9 @@ else: OFF_ON = ["OFF", "ON"] BUILD_STATIC = "shared" not in flags +"""Whether dependencies are built static.""" +IFCOPENSHELL_STATIC = BUILD_STATIC and "ifcopenshell-shared" not in flags +"""Whether IfcOpenShell's own libraries are built static.""" ENABLE_FLAG = "--enable-static" if BUILD_STATIC else "--enable-shared" DISABLE_FLAG = "--disable-shared" if BUILD_STATIC else "--disable-static" LINK_TYPE = "static" if BUILD_STATIC else "shared" @@ -1411,7 +1416,7 @@ os.makedirs(ifcos_build_dir, exist_ok=True) cmake_args = [ "-DUSE_MMAP=OFF", "-DBUILD_EXAMPLES=OFF", - "-DBUILD_SHARED_LIBS=" + OFF_ON[not BUILD_STATIC], + "-DBUILD_SHARED_LIBS=" + OFF_ON[not IFCOPENSHELL_STATIC], "-DGLTF_SUPPORT=ON", "-DBoost_NO_BOOST_CMAKE=On", "-DCREATE_BUNDLE=On",