Skip to content

Commit 6029038

Browse files
authored
Merge pull request #5 from tresf/osx-minos
Echo minos value of binary when compiling for macOS
2 parents 263ce36 + c7eecb2 commit 6029038

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ if(APPLE)
5454
endif()
5555
endif()
5656

57+
set(CMAKE_CXX_STANDARD 11)
58+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
59+
5760
# Statically link gcc/c++
5861
if(MSVC)
5962
# /MT = Multithread, static version of the run-time library

ant/build.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
<echo level="info"/>
225225
</target>
226226

227-
<target name="show-file-info">
227+
<target name="show-file-info" depends="main-props">
228228
<!-- Show binary output file information -->
229229
<fileset id="native.files" dir="${maven.nativelibdir.path}" includes="*"/>
230230
<echo level="info">File information:</echo>
@@ -239,22 +239,21 @@
239239
<!-- Convert path to unix format -->
240240
<pathconvert targetos="unix" property="native.file.unix" refid="native.files"/>
241241

242-
<!-- Prepare command ("file" on unix, "sh.exe" on Windows)-->
243-
<condition property="exec.command" value="${git.sh}" else="file">
242+
<!-- Prepare command ("sh" on unix, "sh.exe" on Windows)-->
243+
<condition property="exec.command" value="${git.sh}" else="sh">
244244
<resourceexists>
245245
<file file="${git.sh}"/>
246246
</resourceexists>
247247
</condition>
248248

249-
<!-- Prepare argument line -->
250-
<condition property="exec.argline" value="-c &quot;file '${native.file.unix}'&quot;" else="'${native.file.unix}'">
251-
<resourceexists>
252-
<file file="${git.sh}"/>
253-
</resourceexists>
249+
<!-- Retreive minos value (macOS only) -->
250+
<condition property="exec.argline" value="otool -l '${native.file.unix}' |grep -E -A4 '(LC_VERSION_MIN_MACOSX|LC_BUILD_VERSION)' | grep -B1 sdk" else="cd .">
251+
<equals arg1="${os.target.name}" arg2="osx"/>
254252
</condition>
255253

254+
<!-- Prepare argument line -->
256255
<exec executable="${exec.command}">
257-
<arg line="${exec.argline}"/>
256+
<arg line="-c &quot;file '${native.file.unix}'&amp;&amp; ${exec.argline}&quot;"/>
258257
</exec>
259258
<echo level="info"></echo>
260259
</target>

0 commit comments

Comments
 (0)