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

Replaced std::optional.value() with * dereferencing #101

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/julia/build_tarballs_release.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,6 @@ cd $WORKSPACE/srcdir/Uno
mkdir -p build
cd build

if [[ "${target}" == x86_64-apple-darwin* ]]; then
# Work around the issue
# /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14
# Presets::set(options, optional_preset.value());
# ^
# /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here
# constexpr value_type const& value() const&
# ^
export MACOSX_DEPLOYMENT_TARGET=10.15
# ...and install a newer SDK which supports `std::filesystem`
pushd $WORKSPACE/srcdir/MacOSX10.*.sdk
# CV: replacing rm -rf with mv to fix https://github.com/cvanaret/Uno/issues/94
# rm -rf /opt/${target}/${target}/sys-root/System
mv /opt/${target}/${target}/sys-root/System /opt/${target}/${target}/sys-root/System_old
cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/."
cp -ra System "/opt/${target}/${target}/sys-root/."
popd
fi

if [[ "${target}" == *mingw* ]]; then
LIBHIGHS=${prefix}/lib/libhighs.dll.a
else
Expand Down
17 changes: 0 additions & 17 deletions .github/julia/build_tarballs_yggdrasil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ cd $WORKSPACE/srcdir/Uno
mkdir -p build
cd build

if [[ "${target}" == x86_64-apple-darwin* ]]; then
# Work around the issue
# /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14
# Presets::set(options, optional_preset.value());
# ^
# /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here
# constexpr value_type const& value() const&
# ^
export MACOSX_DEPLOYMENT_TARGET=10.15
# ...and install a newer SDK which supports `std::filesystem`
pushd $WORKSPACE/srcdir/MacOSX10.*.sdk
rm -rf /opt/${target}/${target}/sys-root/System
cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/."
cp -ra System "/opt/${target}/${target}/sys-root/."
popd
fi

if [[ "${target}" == *mingw* ]]; then
LBT=blastrampoline-5
LIBHIGHS=${prefix}/lib/libhighs.dll.a
Expand Down
9 changes: 4 additions & 5 deletions .github/julia/generate_binaries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ for (platform, libdir, ext) in platforms
run(`tar -xzf products/$platform/deps.tar.gz -C products/$platform`)

# Copy the license of each dependency
# CV: comment out temporarily
#for folder in readdir("products/$platform/deps/licenses")
# cp("products/$platform/deps/licenses/$folder", "products/$platform/share/licenses/$folder")
#end
#rm("products/$platform/deps/licenses", recursive=true)
for folder in readdir("products/$platform/deps/licenses")
cp("products/$platform/deps/licenses/$folder", "products/$platform/share/licenses/$folder")
end
rm("products/$platform/deps/licenses", recursive=true)

# Copy the shared library of each dependency
for file in readdir("products/$platform/deps")
Expand Down
2 changes: 1 addition & 1 deletion bindings/AMPL/uno_ampl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) {
// possibly set options from an option file
const auto optional_option_file = command_line_options.get_string_optional("option_file");
if (optional_option_file.has_value()) {
Options file_options = Options::load_option_file(optional_option_file.value());
Options file_options = Options::load_option_file(*optional_option_file);
options.overwrite_with(file_options);
}

Expand Down
4 changes: 2 additions & 2 deletions uno/options/Presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace uno {

/** optional user preset **/
if (optional_preset.has_value()) {
Presets::set(options, optional_preset.value());
Presets::set(options, *optional_preset);
}
else {
/** default preset **/
Expand Down Expand Up @@ -152,4 +152,4 @@ namespace uno {
throw std::runtime_error("The preset " + preset_name + " is not known");
}
}
} // namespace
} // namespace