Skip to content

Commit 50ca97a

Browse files
authored
Get canonical location before asking for parent path (openscad#5448)
* Get canonical location before asking for parent path to correctly resolve a possible symlink of the openscad executable itself * Make boost::dll use std::filesystem, remove boost::filesystem from OpenSCAD dependencies
1 parent 3f0038d commit 50ca97a

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,11 @@ if (MSVC)
284284
message(STATUS "Eigen: ${Eigen3_VERSION}")
285285

286286
set(Boost_USE_STATIC_LIBS TRUE)
287-
find_package(Boost 1.56 REQUIRED COMPONENTS filesystem system regex program_options)
287+
find_package(Boost 1.61 REQUIRED COMPONENTS system regex program_options)
288288
message(STATUS "Boost: ${Boost_VERSION}")
289289
target_include_directories(OpenSCAD SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
290290
target_link_libraries(OpenSCAD PRIVATE ${Boost_LIBRARIES})
291+
target_compile_definitions(OpenSCAD PRIVATE BOOST_DLL_USE_STD_FS)
291292

292293
find_package(harfbuzz CONFIG REQUIRED)
293294
find_path(HARFBUZZ_INCLUDE_DIRS harfbuzz)
@@ -331,10 +332,11 @@ else()
331332
target_compile_definitions(OpenSCAD PRIVATE EIGEN_DONT_ALIGN)
332333
message(STATUS "Eigen: ${Eigen3_VERSION}")
333334

334-
find_package(Boost 1.56 REQUIRED COMPONENTS filesystem system regex program_options)
335+
find_package(Boost 1.61 REQUIRED COMPONENTS system regex program_options)
335336
message(STATUS "Boost: ${Boost_VERSION}")
336337
target_include_directories(OpenSCAD SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
337338
target_link_libraries(OpenSCAD PRIVATE ${Boost_LIBRARIES})
339+
target_compile_definitions(OpenSCAD PRIVATE BOOST_DLL_USE_STD_FS)
338340

339341
find_package(HarfBuzz 0.9.19 REQUIRED QUIET)
340342
message(STATUS "Harfbuzz: ${HARFBUZZ_VERSION}")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Follow the instructions for the platform you're compiling on below.
109109
* [CGAL (5.4 ->)](https://www.cgal.org/)
110110
* [GMP (5.x)](https://gmplib.org/)
111111
* [MPFR (3.x)](https://www.mpfr.org/)
112-
* [boost (1.56 ->)](https://www.boost.org/)
112+
* [boost (1.61 ->)](https://www.boost.org/)
113113
* [OpenCSG (1.4.2 ->)](http://www.opencsg.org/)
114114
* [GLEW (1.5.4 ->)](http://glew.sourceforge.net/)
115115
* [Eigen (3.x)](https://eigen.tuxfamily.org/)

scripts/macosx-build-dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ OPTION_X86_64=false
3838

3939
PACKAGES=(
4040
"double_conversion 3.2.1"
41-
"boost 1.81.0"
41+
"boost 1.86.0"
4242
"eigen 3.4.0"
4343
"gmp 6.3.0"
4444
"mpfr 4.2.0"
@@ -359,7 +359,7 @@ build_boost()
359359
ARCH_FLAGS+=(-arch $arch)
360360
done
361361

362-
./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,filesystem,chrono,system,regex,date_time,atomic
362+
./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,chrono,system,regex,date_time,atomic
363363
./b2 -j"$NUMCPU" -d+2 $BOOST_TOOLSET cflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN ${ARCH_FLAGS[*]}" linkflags="-mmacosx-version-min=$MAC_OSX_VERSION_MIN ${ARCH_FLAGS[*]} -headerpad_max_install_names" install
364364
}
365365

scripts/uni-get-dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ get_qomo_deps()
3535

3636
get_altlinux_deps()
3737
{
38-
for i in boost-devel boost-filesystem-devel gcc4.5 gcc4.5-c++ boost-program_options-devel \
38+
for i in boost-devel gcc4.5 gcc4.5-c++ boost-program_options-devel \
3939
boost-thread-devel boost-system-devel boost-regex-devel eigen3 \
4040
libmpfr libgmp libgmp_cxx-devel qt5-devel libcgal-devel git-core tbb-devel \
4141
libglew-devel flex bison curl imagemagick gettext glib2-devel; do apt-get install $i; done
@@ -64,7 +64,7 @@ get_opensuse_deps()
6464
glib2-devel gettext freetype-devel harfbuzz-devel \
6565
qscintilla-qt5-devel libqt5-qtbase-devel libQt5OpenGL-devel \
6666
xvfb-run libzip-devel libqt5-qtmultimedia-devel libqt5-qtsvg-devel \
67-
double-conversion-devel libboost_filesystem-devel libboost_regex-devel \
67+
double-conversion-devel libboost_regex-devel \
6868
libboost_program_options-devel tbb-devel
6969
# qscintilla-qt5-devel replaces libqscintilla_qt5-devel
7070
# but openscad compiles with both

snap/snapcraft.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ parts:
128128
- libboost-dev
129129
- libboost-regex-dev
130130
- libboost-system-dev
131-
- libboost-filesystem-dev
132131
- libboost-program-options-dev
133132
- libdouble-conversion-dev
134133
- chrpath
@@ -146,7 +145,6 @@ parts:
146145
stage-packages:
147146
- qtwayland5
148147
- libasyncns0
149-
- libboost-filesystem1.71.0
150148
- libboost-regex1.71.0
151149
- libboost-system1.71.0
152150
- libboost-program-options1.71.0

src/openscad.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ int main(int argc, char **argv)
670670
PlatformUtils::ensureStdIO();
671671
#endif
672672

673-
const auto applicationPath = weakly_canonical(boost::dll::program_location().parent_path()).generic_string();
673+
const auto applicationPath = weakly_canonical(boost::dll::program_location()).parent_path().generic_string();
674674
PlatformUtils::registerApplicationPath(applicationPath);
675675

676676
#ifdef ENABLE_CGAL

0 commit comments

Comments
 (0)