Skip to content

Commit 699db19

Browse files
committed
Merged some build file fixes from toggle_masks
Fixed white space.
1 parent 970fabb commit 699db19

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

build.xml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2929
<property name="ant.project.vendor" value="Alexander Barker ([email protected])" />
3030
<property name="ant.project.version" value="${ant.build.major}.${ant.build.minor}.${ant.build.revision}" />
3131

32-
<property file="build.properties" />
3332
<property environment="env" />
3433

3534
<!-- Path Settings -->
@@ -69,6 +68,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6968
<echo>Cleaning all build related items...</echo>
7069

7170
<delete includeEmptyDirs="true" verbose="true" failonerror="false">
71+
<fileset file="${basedir}/build.properties" />
72+
7273
<fileset dir="${dir.dist}" />
7374
<fileset dir="${dir.doc}" />
7475
<fileset file="${dir.jar}/${ant.project.name}.jar" />
@@ -131,6 +132,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
131132
</condition>
132133
</fail>
133134

135+
<property file="build.properties" />
134136

135137
<!-- Try to locate the include folder for java headers -->
136138
<condition property="ant.build.javac.include" value="${env.JDK_HOME}/include">
@@ -167,13 +169,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
167169
</fail>
168170

169171

170-
<!-- Set the default javac build properties. -->
171-
<property name="ant.build.javac.compiler" value="modern" />
172-
<property name="ant.build.javac.source" value="${ant.java.version}" />
173-
<property name="ant.build.javac.target" value="${ant.java.version}" />
174-
<property name="ant.build.javac.args" value="" />
175-
176-
177172
<!-- Define the JNI Tasks provided by classpathref. -->
178173
<typedef resource="org/jnitasks/antlib.xml" classpathref="ant.project.class.path" onerror="failall" />
179174

@@ -276,6 +271,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
276271
</condition>
277272
<property name="ant.build.native.toolchain" value="gcc" />
278273

274+
<!-- Set parallel jobs. -->
275+
<property name="ant.build.native.jobs" value="auto" />
276+
277+
<!-- Set default compiler and linker flags. -->
278+
<condition property="ant.build.native.cflags" value="-O1 -g -pipe" else="-O2 -pipe">
279+
<istrue value="${ant.build.debug}" />
280+
</condition>
281+
<property name="ant.build.native.ldflags" value="" />
282+
283+
<!-- Set default javac options. -->
284+
<property name="ant.build.debug" value="false" />
285+
<property name="ant.build.javac.compiler" value="modern" />
286+
<property name="ant.build.javac.source" value="${ant.java.version}" />
287+
<property name="ant.build.javac.target" value="${ant.java.version}" />
288+
<property name="ant.build.javac.args" value="" />
279289

280290
<!-- Set system specific library name. -->
281291
<condition property="ant.build.native.executable" value="lib${ant.project.name}.dylib">
@@ -303,6 +313,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
303313
<echo level="info">Native Toolchain: ${ant.build.native.toolchain}</echo>
304314
<echo level="info">Native CFLAGS: ${ant.build.native.cflags}</echo>
305315
<echo level="info">Native LDFLAGS: ${ant.build.native.ldflags}</echo>
316+
317+
<!-- Create property file for the descovered values -->
318+
<propertyfile file="build.properties" comment="auto-generated by ant configure">
319+
<entry key="ant.build.debug" value="${ant.build.debug}" />
320+
321+
<entry key="ant.build.javac.compiler" value="${ant.build.javac.compiler}" />
322+
<entry key="ant.build.javac.source" value="${ant.build.javac.source}" />
323+
<entry key="ant.build.javac.target" value="${ant.build.javac.target}" />
324+
<entry key="ant.build.javac.include" value="${ant.build.javac.include}" />
325+
<entry key="ant.build.javac.args" value="${ant.build.javac.args}" />
326+
327+
<entry key="ant.build.native.toolchain" value="${ant.build.native.toolchain}" />
328+
<entry key="ant.build.native.jobs" value="${ant.build.native.jobs}" />
329+
<entry key="ant.build.native.cflags" value="${ant.build.native.cflags}" />
330+
<entry key="ant.build.native.ldflags" value="${ant.build.native.ldflags}" />
331+
</propertyfile>
306332
</target>
307333

308334

src/jni/jni_Converter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jint jni_ConvertToNativeType(jint javaType, event_type *nativeType) {
7474
case org_jnativehook_mouse_NativeMouseEvent_NATIVE_MOUSE_DRAGGED:
7575
case org_jnativehook_mouse_NativeMouseEvent_NATIVE_MOUSE_WHEEL:
7676
*nativeType = (javaType + 6) - org_jnativehook_mouse_NativeMouseEvent_NATIVE_MOUSE_FIRST;
77-
break;
77+
break;
7878

7979
default:
8080
*nativeType = 0;

src/jni/jni_Properties.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void jni_SetProperties(JNIEnv *env) {
5959

6060
long delay = hook_get_auto_repeat_delay();
6161
if (delay >= 0) {
62-
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_auto_repeat_delay(): successful. (%li)\n",
62+
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_auto_repeat_delay(): successful. (%li)\n",
6363
__FUNCTION__, __LINE__, delay);
6464

6565
if (snprintf(buffer, sizeof(buffer), "%li", delay) >= 0) {
@@ -119,7 +119,7 @@ void jni_SetProperties(JNIEnv *env) {
119119

120120
long threshold = hook_get_pointer_acceleration_threshold();
121121
if (threshold >= 0) {
122-
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_pointer_acceleration_threshold(): successful. (%li)\n",
122+
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_pointer_acceleration_threshold(): successful. (%li)\n",
123123
__FUNCTION__, __LINE__, threshold);
124124

125125
if (snprintf(buffer, sizeof(buffer), "%li", threshold) >= 0) {
@@ -149,7 +149,7 @@ void jni_SetProperties(JNIEnv *env) {
149149

150150
long sensitivity = hook_get_pointer_sensitivity();
151151
if (sensitivity >= 0) {
152-
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_pointer_sensitivity(): successful. (%li)\n",
152+
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_pointer_sensitivity(): successful. (%li)\n",
153153
__FUNCTION__, __LINE__, sensitivity);
154154

155155
if (snprintf(buffer, sizeof(buffer), "%li", sensitivity) >= 0) {
@@ -179,7 +179,7 @@ void jni_SetProperties(JNIEnv *env) {
179179

180180
long clicktime = hook_get_multi_click_time();
181181
if (clicktime >= 0) {
182-
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_multi_click_time(): successful. (%li)\n",
182+
jni_Logger(env, LOG_LEVEL_DEBUG, "%s [%u]: hook_get_multi_click_time(): successful. (%li)\n",
183183
__FUNCTION__, __LINE__, clicktime);
184184

185185
if (snprintf(buffer, sizeof(buffer), "%li", clicktime) >= 0) {

0 commit comments

Comments
 (0)