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

MinGW support #2356

Closed
ark0f opened this issue Jun 2, 2018 · 9 comments
Closed

MinGW support #2356

ark0f opened this issue Jun 2, 2018 · 9 comments

Comments

@ark0f
Copy link
Member

ark0f commented Jun 2, 2018

Why POCO doesn't have MinGW support? I think it is not difficult. I can even add support personally.

@aleks-f
Copy link
Member

aleks-f commented Jun 2, 2018

if you want to own it, it's yours. send pulls with fixes and if they don't break other builds, they will be merged. see with @zosrothko if there is space in CI environment for it

@zosrothko
Copy link
Member

zosrothko commented Jun 2, 2018

On AppVeyor, there is space.. on VSTS, it remains 25GB but one should keep it for VS addition. Thus I would suggest to CI the MinGW on AppVeyor.
@Good-Pudge Please ask for a account on Slack to easy the communication

@aleks-f
Copy link
Member

aleks-f commented Jun 2, 2018

yes, appveyor will be fine. @Good-Pudge I have sent you invite for slack

ark0f added a commit to ark0f/poco that referenced this issue Jun 2, 2018
TODO list:
* Fix tests compilation (undefined reference to CppUnit::...)
* Fix SQLs compilation (No rule to make target '${LIBNAME}.dll.a', needed by '${LIBNAME}.dll'.  Stop.)
* Fix crypto executables compilation
* Test static compilation
* Test MSVC compilation
* Add unicode support

See pocoproject#2356
ark0f added a commit to ark0f/poco that referenced this issue Jun 3, 2018
Also fix PDF test runner.

TODO list:
* Fix tests compilation (undefined reference to CppUnit::...)
* Add unicode support
* Resolve what to do with message compiler

See pocoproject#2356
ark0f added a commit to ark0f/poco that referenced this issue Jun 4, 2018
…ral implementations. Add "POCO_NO_MINGW_UNICODE" for "wmain".

TODO list:
* Check PostgreSQL and MySQL
* Resolve what to do with message compiler

See pocoproject#2356
ark0f added a commit to ark0f/poco that referenced this issue Jun 5, 2018
aleks-f pushed a commit that referenced this issue Jun 19, 2018
* Add MinGW support (not full yet).

TODO list:
* Fix tests compilation (undefined reference to CppUnit::...)
* Fix SQLs compilation (No rule to make target '${LIBNAME}.dll.a', needed by '${LIBNAME}.dll'.  Stop.)
* Fix crypto executables compilation
* Test static compilation
* Test MSVC compilation
* Add unicode support

See #2356

* Code rearrange.

Also fix PDF test runner.

TODO list:
* Fix tests compilation (undefined reference to CppUnit::...)
* Add unicode support
* Resolve what to do with message compiler

See #2356

* Normal "_DLL" definition for MinGW. Add missing "Crypto_API" for several implementations. Add "POCO_NO_MINGW_UNICODE" for "wmain".

TODO list:
* Check PostgreSQL and MySQL
* Resolve what to do with message compiler

See #2356

* Test PostgreSQL. Fix message compiler problem.

See #2356

* Perform requested changes. Add WinCE check.

See #2360

* Perform requested changes #2. Delete WinCE check.

See #2360

* Perform requested changes #3. Net initializer should works now.

See #2360

* Fix invalid indent.

See #2360

* Correct definition of POCO_NO_MINGW_UNICODE.

See #2360

* Remove macro and set global linke flags for testing purpose

* Add -municode for mingw where wmain is used

* Delete "POCO_ENABLE_EXE_WMAIN". Add PollSet support.

See #2360

* Restore WinCE linker flags. Set _WIN32_WINNT in PollSet.cpp separately. Add var to disable MinGW wmain wrapper.

* Fix compilation.

* Fix missing argument name in functions "setEscapeUnicode" in JSON package.
@aleks-f aleks-f added this to the Release 2.0.0 milestone Jun 19, 2018
@ark0f ark0f mentioned this issue Jun 30, 2018
@qwertychouskie
Copy link

For the error in PocoMacros.cmake, these modified code chunks should work, at least with 1.9.0:

if (WIN32)
  # cmake has CMAKE_RC_COMPILER, but no message compiler
  if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
    # this path is only present for 2008+, but we currently require PATH to
    # be set up anyway
    get_filename_component(sdk_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH)
    get_filename_component(kit_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot]" REALPATH)
    get_filename_component(kit81_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot81]" REALPATH)
    if (X64)
      set(sdk_bindir "${sdk_dir}/bin/x64")
      set(kit_bindir "${kit_dir}/bin/x64")
      set(kit81_bindir "${kit81_dir}/bin/x64")
    else (X64)
      set(sdk_bindir "${sdk_dir}/bin")
      set(kit_bindir "${kit_dir}/bin/x86")
      set(kit81_bindir "${kit81_dir}/bin/x86")
    endif (X64)
  endif ()
  find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}"
    DOC "path to message compiler")
  if (NOT CMAKE_MC_COMPILER)
    message(WARNING "Message compiler not found, using pre-generated headers")
  endif (NOT CMAKE_MC_COMPILER)
  message(STATUS "Found message compiler: ${CMAKE_MC_COMPILER}")
  mark_as_advanced(CMAKE_MC_COMPILER)
endif(WIN32)

...

macro(POCO_MESSAGES out name)
    if (WIN32 AND CMAKE_MC_COMPILER)
        foreach(msg ${ARGN})
            get_filename_component(msg_name ${msg} NAME)
            get_filename_component(msg_path ${msg} ABSOLUTE)
            string(REPLACE ".mc" ".h" hdr ${msg_name})
            set_source_files_properties(${hdr} PROPERTIES GENERATED TRUE)
            add_custom_command(
                OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${hdr}
                DEPENDS ${msg}
                COMMAND ${CMAKE_MC_COMPILER}
                ARGS
                    -h ${CMAKE_CURRENT_BINARY_DIR}
                    -r ${CMAKE_CURRENT_BINARY_DIR}
                    ${msg_path}
                VERBATIM # recommended: p260
            )

            # Add the generated file to the include directory
            include_directories(${CMAKE_CURRENT_BINARY_DIR})

            # Add the generated headers to POCO_HEADERS of the component
            POCO_HEADERS( ${out} ${name} ${CMAKE_CURRENT_BINARY_DIR}/${hdr})

        endforeach()

        set_source_files_properties(${ARGN} PROPERTIES HEADER_FILE_ONLY TRUE)
        source_group("${name}\\Message Files" FILES ${ARGN})
        list(APPEND ${out} ${ARGN})

    endif (WIN32 AND CMAKE_MC_COMPILER)
endmacro()

And the contents of Foundation/src/pocomsg.h (which would normally be generated by mc.exe):

//
// pocomsg.mc[.h]
//
// The Poco message source/header file.
//
// NOTE: pocomsg.h is automatically generated from pocomsg.mc.
//       Never edit pocomsg.h directly!
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
//
// Categories
//
//
//  Values are 32 bit values laid out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-+-----------------------+-------------------------------+
//  |Sev|C|R|     Facility          |               Code            |
//  +---+-+-+-----------------------+-------------------------------+
//
//  where
//
//      Sev - is the severity code
//
//          00 - Success
//          01 - Informational
//          10 - Warning
//          11 - Error
//
//      C - is the Customer code flag
//
//      R - is a reserved bit
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//
//
// Define the facility codes
//


//
// Define the severity codes
//


//
// MessageId: POCO_CTG_FATAL
//
// MessageText:
//
// Fatal
//
#define POCO_CTG_FATAL                   0x00000001L

//
// MessageId: POCO_CTG_CRITICAL
//
// MessageText:
//
// Critical
//
#define POCO_CTG_CRITICAL                0x00000002L

//
// MessageId: POCO_CTG_ERROR
//
// MessageText:
//
// Error
//
#define POCO_CTG_ERROR                   0x00000003L

//
// MessageId: POCO_CTG_WARNING
//
// MessageText:
//
// Warning
//
#define POCO_CTG_WARNING                 0x00000004L

//
// MessageId: POCO_CTG_NOTICE
//
// MessageText:
//
// Notice
//
#define POCO_CTG_NOTICE                  0x00000005L

//
// MessageId: POCO_CTG_INFORMATION
//
// MessageText:
//
// Information
//
#define POCO_CTG_INFORMATION             0x00000006L

//
// MessageId: POCO_CTG_DEBUG
//
// MessageText:
//
// Debug
//
#define POCO_CTG_DEBUG                   0x00000007L

//
// MessageId: POCO_CTG_TRACE
//
// MessageText:
//
// Trace
//
#define POCO_CTG_TRACE                   0x00000008L

//
// Event Identifiers
//
//
// MessageId: POCO_MSG_LOG
//
// MessageText:
//
// %1
//
#define POCO_MSG_LOG                     0x00001000L

@qwertychouskie
Copy link

qwertychouskie commented Mar 15, 2019

Hmm, it seems the issue has been fixed in develop for systems that have mc.exe, though this may be useful for anyone looking to cross-compile Windows binaries on Linux.

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Jun 28, 2022
@aleks-f
Copy link
Member

aleks-f commented Jun 28, 2022

I'll leave this open for now if anyone care to carry the changes from develop over to devel (sorry that 2.0 did not happen, but we simply don't have resources to support two lines of development/support).

@aleks-f aleks-f modified the milestones: Release 2.0.0, Unspecified Jun 28, 2022
@aleks-f aleks-f removed the stale label Jun 28, 2022
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Nov 28, 2023
Copy link

This issue was closed because it has been inactive for 60 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants