Travis CI how to build debug and release? - travis-ci

I have a C++ project and sometimes the release and debug code gets out of sync (some code is #ifdef'd out or breaks with diff compiler options).
I'd like Travis-CI to build both debug and release, how can I do it? If it can be done will this also work with the multiple compiler matrix? I.e would it allow me to build debug and release on g++ and clang?

Related

Xcode build phases: Use previous build warning output in "run script" phase

I want to have a run script that looks at the number of previous warnings (probably during the compile phase), and generates an error which stops the run/buid if the number of warnings is too large.
I am working on an app that has a large amount of warnings that happen during compile. They do not stop the app from compiling, but I want to stop devs from adding more warnings as they add features.
I have looked everywhere, but so far have not found a way to use previous build output in the run script phase of the build. Is there any way of doing this? Some kind of env variable, or a way of monitoring the build output in a custom script as it happens?
I see a similar question here:
Is there a way to access Xcodes current build output from a build phase run script?
But it seems that the output is only available after the build is complete in that answer. Is there any other option that would allow the build to be failed before it finishes?
Any insight into the build system in Xcode would be appreciated! Cheers
Additional context:
All I need is for Xcode's default warnings to have a feature similar to SwiftLint's warning_threshold
https://stackoverflow.com/a/52256459/7623867
I have looked into that problem as well for quite some time (I wanted to use warnings for quality measurement). The only way I have found is to compile the whole project with xcodebuild, with a command similar to:
xcrun xcodebuild -project MyProject.xcodeproj/ -scheme MyScheme -destination "platform=iOS Simulator" build -quiet | tee xcodebuild.log
and then counting the warnings using AWK or some other tool.
Here is an example.

How can I make Kotlin-native executable with runtime debug information?

In Personally, I am modifying and testing some features of the kotlin-native memory manager.
But, I am struggling to find a way to create an OSX XCode executable, including debugging information of the C++ sources in kotlin-native runtime.
'kotlinc -g ..' generates only debug informations for Kotlin sources.
Please let me know how to build debugging version of runtime and link the debug information into sample kotlin apps.
I am using Kotlin-native 1.3.72, and Xcode 11.5
I think the only available option here is to re-build Kotlin/Native runtime with adding -g compiler option to the Gradle script. See this file and line, probably it should be the correct place.

Release Version of iOS App Is Hitting DEBUG Flags

In my schema, I have specified Release as the build type:
In my code I have some checks to see if it's in DEBUG or RELEASE. However it always hits the DEBUG (line 125 in the example below):
Do you know what I might be missing when I build for release so it stops hitting the DEBUG flags?
Conditional compilation like this does not depend on the Build Configuration but the presence of the DEBUG flag within that configuration.
Go to your project's build settings and search for 'flag'. Look under 'Swift Compiler - Custom Flags' and then 'Active Compilation Conditions': each build configuration is then listed and the flag DEBUG should be present where you want your debug code to appear but absent where you do not.

How do you compile Halide for iOS?

The README claims it can compile to armv7, but I cannot find the magic incantation to make it work.
I started down the rabbit hole of changing the Makefile to set the arch=armv7, fixing the resulting compilation errors, etc, but that doesn't seem like the right way to go about it.
There recommended cmake flags are:
cmake -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release ..
But alas, the bin directory contains only a .a and a .so, both of which are compiled for x86_64. There are no dylibs.
I can successfully run the test iOS app in the simulator, linking with the x86 libraries, but I cannot build on a device since there are no arm binaries.
Here is a link to the Halide test app I'm trying to build:
https://github.com/halide/Halide/tree/master/apps/HelloiOS
You should use AOT compilation for iOS. The JIT in principle works on ARM (the architecture), but not on iOS (the OS).
Clarification: are you trying to build Halide to run on ARM, or merely to generate code for ARM? (If the latter, any target will do, as all builds of Halide can generate code for all known targets.)

How do you determine the build options that XCode uses so you can use them with xcodebuild?

I want to build my iOS projects with xcodebuild, but to do so I need to figure out all the flags and options that XCode is using to build my project when I build and run in XCode.
How can I find out what compilation flags and such XCode is using during the build process, so that I can figure out the equivalent xcodebuild command? I'm especially interested in getting this to work when I'm including external libraries like RestKit in my project.
All you need to do is tell xcodebuild the target and the configuration; everything else is contained in the project relating to the configuration.
See the manpage.

Resources