Hi all,

a patch fixing the problem with windres (or actually, resource
compilation problems, I found and fixed a second one with syntax)
is attached to this e-mail. I required the -DHAVE_BOOLEAN solution
for it to work, but if you didn't require it this I expect this to
still be unchanged. Of course, this only tested with cmake 3.2.2 (I
don't have another version yet, 3.3.2-2 is current, should I re-test?).

@zyx: You recommended me to upgrade build tools, which did you mean and
to which versions (I'm using GNU/Linux for development)?

@All: Please review the patch attached and if accepted, please commit it
(separately) to the public repository, if not, please tell me why not.

Best regards, mabri



----- Original Message -----
From: zyx <z...@litepdf.cz>
To: podofo-users@lists.sourceforge.net
Sent: 19:47 Sunday, 15 November 2015
Subject: Re: [Podofo-users] MinGW-w64 cross-build problem: windres not taking 
compiler options

On Sat, 2015-11-14 at 11:42 +0000, Matthew Brincke wrote:
> @Reviewers/Committers: Could you please review the patches used by
> Svetlana Watkins, and if accepted commit them (separately) to the
> public repository, otherwise please tell me why not?
> I'll probably post a patch for making (cross-)building for Win32
> work with cmake 3.2.2 on GNU/Linux in the near future (I have time
> now).

    Hello,
I'd prefer to have one final patch for the build, rather than hunt the
mailing list for several patches (I know you gave links to some).

I tried to build revision 1690 in my MinGW/MSYS environment and I
didn't face any code-compilation issues using cmake version 2.8.12.2.
What I did in msys:
a) get the checkout of the PoDoFo sources
b) create a 'build' directory inside it
c) cd ./build
d) cmake -G "MSYS Makefiles" -DFREETYPE_INCLUDE_DIR=path/to/include/freetype2/ 
..
e) make
   [there was some generation error for the windres.exe call, some
    unknown option 's' being used, thus I dropped the compilation of
    the .rc file for testing, then re-run the 'make' and it succeeded]

Then I was able to run helloworld.exe and helloworld-base14.exe and it
generated the pdf files.

That can mean that if you face compilations issues, then you might want
to update the build tools, maybe. I had also issues with the build, but
only with the resource compilers.
    Bye,
    zyx

-- 
http://www.litePDF.cz                                 i...@litepdf.cz




------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users
Index: src/base/PdfDefines.h
===================================================================
--- src/base/PdfDefines.h	(revision 1690)
+++ src/base/PdfDefines.h	(working copy)
@@ -55,14 +55,20 @@
  */
 #define PODOFO_MAKE_VERSION_REAL(M,m,p) ( (M<<16)+(m<<8)+(p) )
 #define PODOFO_MAKE_VERSION(M,m,p) PODOFO_MAKE_VERSION_REAL(M,m,p)
-#define PODOFO_VERSION PODOFO_MAKE_VERSION(PODOFO_VERSION_MAJOR, PODOFO_VERSION_MINOR, PODOFO_VERSION_PATCH)
+#define PODOFO_VERSION PODOFO_MAKE_VERSION(PODOFO_VERSION_MAJOR, \
+        PODOFO_VERSION_MINOR, PODOFO_VERSION_PATCH)
 
 /**
  * PoDoFo version represented as a string literal, eg '0.7.99'
  */
-#define PODOFO_MAKE_VERSION_STR_REAL(M,m,p) ("\"" #M "." #m "." #p "\"")
-#define PODOFO_MAKE_VERSION_STR(M,m,p) PODOFO_MAKE_VERSION_STR_REAL(M,m,p)
-#define PODOFO_VERSION_STR PODOFO_MAKE_VERSION_STR(PODOFO_VERSION_MAJOR, PODOFO_VERSION_MINOR, PODOFO_VERSION_PATCH)
+// The \0 is from Win32 example resources and the other values in PoDoFo's one
+#define PODOFO_MAKE_VERSION_STR_REAL(M,m,p) M ## . ## m ## . ## p
+#define PODOFO_STR(x) #x "\0"
+#define PODOFO_XSTR(x) PODOFO_STR(x)
+#define PODOFO_MAKE_VERSION_STR(M,m,p) \
+        PODOFO_XSTR(PODOFO_MAKE_VERSION_STR_REAL(M,m,p))
+#define PODOFO_VERSION_STR PODOFO_MAKE_VERSION_STR(PODOFO_VERSION_MAJOR, \
+        PODOFO_VERSION_MINOR, PODOFO_VERSION_PATCH)
 
 #ifndef PODOFO_COMPILE_RC
 
Index: src/doc/podofo-doc.rc
===================================================================
--- src/doc/podofo-doc.rc	(revision 1690)
+++ src/doc/podofo-doc.rc	(working copy)
@@ -3,7 +3,11 @@
 #include "base/podofoapi.h"
 #include "base/PdfDefines.h"
 #include "base/PdfVersion.h"
+#ifdef __MINGW32__
+#include "winresrc.h"
+#else
 #include "WinResrc.h"
+#endif
 
 #undef PODOFO_COMPILE_RC
 
@@ -50,8 +54,8 @@
     BEGIN
         BLOCK "040904E4"
         BEGIN
-            VALUE "FileVersion", VER_FILEVERSION
-            VALUE "ProductVersion", VER_PRODUCTVERSION
+            VALUE "FileVersion", VER_FILEVERSION_STR
+            VALUE "ProductVersion", VER_PRODUCTVERSION_STR
             VALUE "Comments", "PoDoFo Doc PDF Library\0"
             VALUE "CompanyName", "PoDoFo\0"
             VALUE "InternalName", "podofo\0"
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1690)
+++ CMakeLists.txt	(working copy)
@@ -285,16 +294,16 @@
         SET(PODOFO_USE_VISIBILITY ${PODOFO_HAVE_GCC4})
     ENDIF(NOT DEFINED PODOFO_USE_VISIBILITY)
 
-    ADD_DEFINITIONS(-std=c++98)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
 
-    ADD_DEFINITIONS(
-        -Wall
-        -Woverloaded-virtual
-        -Wswitch-enum
-        -Wcast-qual
-        -Wwrite-strings
-        -Wredundant-decls
-        -Wreorder
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
+        -Wall \
+        -Woverloaded-virtual \
+        -Wswitch-enum \
+        -Wcast-qual \
+        -Wwrite-strings \
+        -Wredundant-decls \
+        -Wreorder"
 		#-Wold-style-cast
        )
     #
------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to