Public export of defines from QT6:Platform polutes my build
-
I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
The reason is that OpenNURBS has the following check:#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) #if defined(_M_X64) && defined(WIN32) && defined(WIN64) // 23 August 2007 Dale Lear #if defined(_INC_WINDOWS) // The user has included Microsoft's windows.h before opennurbs.h, // and windows.h has nested includes that unconditionally define WIN32. // Just undo the damage here or everybody that includes opennurbs.h after // windows.h has to fight with this Microsoft bug. #undef WIN32 #else #error do not define WIN32 for x64 builds #endif
In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.
I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?
In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?
-
I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
The reason is that OpenNURBS has the following check:#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) #if defined(_M_X64) && defined(WIN32) && defined(WIN64) // 23 August 2007 Dale Lear #if defined(_INC_WINDOWS) // The user has included Microsoft's windows.h before opennurbs.h, // and windows.h has nested includes that unconditionally define WIN32. // Just undo the damage here or everybody that includes opennurbs.h after // windows.h has to fight with this Microsoft bug. #undef WIN32 #else #error do not define WIN32 for x64 builds #endif
In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.
I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?
In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?
Fix OpenNURBS. Or convince MS to change it: https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros
-
I've have a project in which I use OpenNURBS. We are in the process of upgrading to QT6.5.3 from QT5.15.2 and I'm having massive problems getting that to work with OpenNURBS
The reason is that OpenNURBS has the following check:#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) #if defined(_M_X64) && defined(WIN32) && defined(WIN64) // 23 August 2007 Dale Lear #if defined(_INC_WINDOWS) // The user has included Microsoft's windows.h before opennurbs.h, // and windows.h has nested includes that unconditionally define WIN32. // Just undo the damage here or everybody that includes opennurbs.h after // windows.h has to fight with this Microsoft bug. #undef WIN32 #else #error do not define WIN32 for x64 builds #endif
In QT5.15.2 only WIN32 was leaked from QT6:Platform and thus it didn't give us any problems, but with the upgrade both WIN32 and WIN64 are leaked which makes the check above fail. I've tried a lot of things to remove that define (it's from QT6Targets.cmake line 62), but it keeps sneaking into my OpenNURBS target.
I'm running out of talent, both regarding CMake and QT so I'm hoping that some of you might have encountered this and knows how to get around it?
In this link: Similar problem it is actually suggested that it is a bug in QTs CMake setup?
-
Did you ever have any luck getting this to work? Running into the same issue and bashing my keyboard into the wall hasn't made me any headway, surprisingly.