Selaa lähdekoodia

Make cross-compilation possible

Kun Zhang 10 vuotta sitten
vanhempi
commit
74c4b648cb
2 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 11 0
      protoc-artifacts/README.md
  2. 1 1
      protoc-artifacts/pom.xml

+ 11 - 0
protoc-artifacts/README.md

@@ -28,6 +28,17 @@ The following command will install the ``protoc`` artifact to your local Maven r
 $ mvn install
 $ mvn install
 ```
 ```
 
 
+## Cross-compilation
+The Maven script will try to detect the OS and the architecture from Java
+system properties. It's possible to build a protoc binary for an arhitecture
+that is different from what Java has detected, as long as you have the proper
+compilers installed. For example, MingGW32 only ships with 32-bit compilers,
+but you can still build 32-bit protoc under a 64-bit system, with the following
+command:
+```
+$ mvn install -Dos.detected.arch=x86_32
+```
+
 ## To push artifacts to Maven Central
 ## To push artifacts to Maven Central
 Before you can upload artifacts to Maven Central repository, make sure you have
 Before you can upload artifacts to Maven Central repository, make sure you have
 read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to
 read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to

+ 1 - 1
protoc-artifacts/pom.xml

@@ -77,7 +77,7 @@
               <artifacts>
               <artifacts>
                 <artifact>
                 <artifact>
                   <file>${basedir}/target/protoc.exe</file>
                   <file>${basedir}/target/protoc.exe</file>
-                  <classifier>${os.detected.classifier}</classifier>
+                  <classifier>${os.detected.name}-${os.detected.arch}</classifier>
                   <type>exe</type>
                   <type>exe</type>
                 </artifact>
                 </artifact>
               </artifacts>
               </artifacts>