From 1fc3d88b83d90dbec34c59639f9b0f3c30119d9b Mon Sep 17 00:00:00 2001 From: Witold Bolt <witold.bolt@gmail.com> Date: Fri, 31 Aug 2012 20:51:36 +0000 Subject: [PATCH] OSX compilation cleanups. --- com.amd.aparapi.jni/build.xml | 20 ++++++++++++++++++-- com.amd.aparapi.jni/src/cpp/cltest.cpp | 2 +- com.amd.aparapi.jni/src/cpp/common.h | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/com.amd.aparapi.jni/build.xml b/com.amd.aparapi.jni/build.xml index 990caf72..7a06656b 100644 --- a/com.amd.aparapi.jni/build.xml +++ b/com.amd.aparapi.jni/build.xml @@ -529,7 +529,6 @@ First consider editing the properties in build.properties <arg value="-g" /> <arg value="-fPIC" /> <arg value="-I/System/Library/Frameworks/JavaVM.framework/Headers" /> - <arg value="-I/System/Library/Frameworks/OpenCL.framework/Headers" /> <arg value="-Iinclude" /> <arg value="-shared" /> <arg value="-o" /> @@ -543,6 +542,7 @@ First consider editing the properties in build.properties <arg value="src/cpp/clHelper.cpp" /> <arg value="-framework" /> <arg value="OpenCL" /> + <arg value="-Wno-write-strings" /> </exec> </target> @@ -627,6 +627,22 @@ First consider editing the properties in build.properties </exec> </target> - <target name="cltest" depends="check,msvc_cltest" /> + <target name="mac_cltest" if="use.gcc_mac"> + <mkdir dir="${basedir}/dist"/> + <echo message="gcc cltest ${os.arch}" /> + <exec executable="g++"> + <arg value="-O3" /> + <arg value="-g" /> + <arg value="-fPIC" /> + <arg value="-I/System/Library/Frameworks/JavaVM.framework/Headers" /> + <arg value="-Iinclude" /> + <arg value="-o" /> + <arg value="${basedir}/dist/cltest" /> + <arg value="src/cpp/cltest.cpp" /> + <arg value="-framework" /> + <arg value="OpenCL" /> + </exec> + </target> + <target name="cltest" depends="check,msvc_cltest,mac_cltest" /> </project> diff --git a/com.amd.aparapi.jni/src/cpp/cltest.cpp b/com.amd.aparapi.jni/src/cpp/cltest.cpp index 8ec9d997..9604dbeb 100644 --- a/com.amd.aparapi.jni/src/cpp/cltest.cpp +++ b/com.amd.aparapi.jni/src/cpp/cltest.cpp @@ -16,7 +16,7 @@ #ifndef __APPLE__ #include <CL/cl.h> #else -#include <cl.h> +#include <opencl/opencl.h> #endif diff --git a/com.amd.aparapi.jni/src/cpp/common.h b/com.amd.aparapi.jni/src/cpp/common.h index 0ee588e6..1abcb7e9 100644 --- a/com.amd.aparapi.jni/src/cpp/common.h +++ b/com.amd.aparapi.jni/src/cpp/common.h @@ -56,7 +56,7 @@ #ifndef __APPLE__ #include <CL/cl.h> #else -#include <cl.h> +#include <opencl/opencl.h> #endif #include <jni.h> -- GitLab