This commit is contained in:
bubnikv 2019-01-29 18:08:02 +01:00
commit 7bfc60e805
6 changed files with 39 additions and 10 deletions

View File

@ -1,8 +1,21 @@
if (MSVC_VERSION EQUAL 1800)
set(DEP_VS_VER "12")
set(DEP_BOOST_TOOLSET "msvc-12.0")
elseif (MSVC_VERSION EQUAL 1900)
set(DEP_VS_VER "14")
set(DEP_BOOST_TOOLSET "msvc-14.0")
elseif (MSVC_VERSION GREATER 1900)
set(DEP_VS_VER "15")
set(DEP_BOOST_TOOLSET "msvc-14.1")
else ()
message(FATAL_ERROR "Unsupported MSVC version")
endif ()
if (${DEPS_BITS} EQUAL 32)
set(DEP_MSVC_GEN "Visual Studio 12")
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
else ()
set(DEP_MSVC_GEN "Visual Studio 12 Win64")
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
endif ()
@ -29,7 +42,7 @@ ExternalProject_Add(dep_boost
--with-regex
"--prefix=${DESTDIR}/usr/local"
"address-model=${DEPS_BITS}"
toolset=msvc-12.0
"toolset=${DEP_BOOST_TOOLSET}"
link=static
variant=release
threading=multi
@ -204,7 +217,7 @@ ExternalProject_Add(dep_libcurl
URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}"
BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}"
INSTALL_COMMAND cd builds\\libcurl-*-release-*-winssl
&& "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
&& "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib"
@ -214,7 +227,7 @@ if (${DEP_DEBUG})
ExternalProject_Add_Step(dep_libcurl build_debug
DEPENDEES build
DEPENDERS install
COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}"
COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}"
WORKING_DIRECTORY "${SOURCE_DIR}"
)
ExternalProject_Add_Step(dep_libcurl install_debug

View File

@ -45,7 +45,9 @@ extern "C" {
#define chdir _chdir
#define isatty _isatty
#define lseek _lseek
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#define stat _stat

View File

@ -53,6 +53,11 @@
#define HAS_INTRINSIC_128_TYPE
#endif
#if defined(_MSC_VER) && defined(_WIN64)
#include <intrin.h>
#pragma intrinsic(_mul128)
#endif
//------------------------------------------------------------------------------
// Int128 class (enables safe math on signed 64bit integers)
// eg Int128 val1((int64_t)9223372036854775807); //ie 2^63 -1

View File

@ -115,7 +115,7 @@ public:
/// subclasses should overload with a specific version
/// Postcondition: Method does not fire the on_change event.
virtual void set_value(const boost::any& value, bool change_event) = 0;
/// Gets a boost::any representing this control.
/// subclasses should overload with a specific version
virtual boost::any& get_value() = 0;
@ -128,6 +128,8 @@ public:
virtual wxString get_tooltip_text(const wxString& default_string);
void field_changed() { on_change_field(); }
// set icon to "UndoToSystemValue" button according to an inheritance of preset
// void set_nonsys_btn_icon(const wxBitmap& icon);

View File

@ -3250,6 +3250,7 @@ bool GLCanvas3D::Gizmos::handle_shortcut(int key, const Selection& selection)
if (!m_enabled || selection.is_empty())
return false;
EType old_current = m_current;
bool handled = false;
for (GizmosMap::iterator it = m_gizmos.begin(); it != m_gizmos.end(); ++it)
{
@ -3273,7 +3274,12 @@ bool GLCanvas3D::Gizmos::handle_shortcut(int key, const Selection& selection)
handled = true;
}
}
else
}
if (handled && (old_current != Undefined) && (old_current != m_current))
{
GizmosMap::const_iterator it = m_gizmos.find(old_current);
if (it != m_gizmos.end())
it->second->set_state(GLGizmoBase::Off);
}

View File

@ -1589,11 +1589,11 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn);
btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent e) {
btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent &e) {
BonjourDialog dialog(parent);
if (dialog.show_and_lookup()) {
optgroup->set_value("print_host", std::move(dialog.get_selected()), true);
// FIXME: emit killfocus on the edit widget
optgroup->get_field("print_host")->field_changed();
}
});
@ -1607,7 +1607,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn);
btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
std::unique_ptr<PrintHost> host(PrintHost::get_print_host(m_config));
if (! host) {
const auto text = wxString::Format("%s",
@ -1648,6 +1648,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
wxFileDialog openFileDialog(this, _(L("Open CA certificate file")), "", "", filemasks, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (openFileDialog.ShowModal() != wxID_CANCEL) {
optgroup->set_value("printhost_cafile", std::move(openFileDialog.GetPath()), true);
optgroup->get_field("printhost_cafile")->field_changed();
}
});