This module introduces an abstract listener for Github hooks with nitcorn.
PS: OMG first PR with syntax highligh!!!! Thx @R4PaSs !
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #1115
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
*.stub.nit.[ch]
.metadata/*
+.github_data
# analysis results. The result graph will be sent to the JavaScript function
# `show_graph` with the source of the graph in Graphviz's dot.
module pep8analysis_web is
- cpp_compiler_option("--std=c++11 --bind")
- c_linker_option("--bind")
+ cppflags "--std=c++11 --bind"
+ ldflags "--bind"
end
import emscripten
--- /dev/null
+#!/usr/bin/env nit
+#
+# This file is part of NIT ( http://www.nitlanguage.org ).
+# This program is public domain
+
+# Task: 100 doors
+# SEE: <http://rosettacode.org/wiki/100_doors>
+
+# A door with two states: open or closed
+class Door
+ # Is this door open?
+ var open = false
+
+ # Toggle bool value of open
+ fun toggle do open = not open
+
+ redef fun to_s: String
+ do
+ return if open then "Open" else "Closed"
+ end
+end
+
+var doors = new Array[Door]
+for door in [0..100[ do doors.add(new Door)
+
+var n = 100
+for visit in [0..n[ do
+ var i = visit
+ while i < n do
+ doors[i].toggle
+ i += visit+1
+ end
+end
+for i in [0..n[ do print "Door {i+1}: {doors[i]}"
# We use the `userData` field of the C structure to store an handle to
# the associated App
private fun user_data: App `{ return recv->userData; `}
- private fun user_data=(val: App) `{ recv->userData = val; `}
+ private fun user_data=(val: App) `{
+ App_incr_ref(val);
+ recv->userData = val;
+ `}
# Fill this in with the function to process input events. At this point
# the event has already been pre-dispatched, and it will be finished upon
fun text=(value: JavaString) in "Java" `{
- android.util.Log.d("Nity", "1");
final TextView final_recv = recv;
final String final_value = value;
- android.util.Log.d("Nity", "4");
((NativeActivity)recv.getContext()).runOnUiThread(new Runnable() {
@Override
public void run() {
- android.util.Log.d("Nity", "-5");
- android.util.Log.d("Nity", final_value);
- android.util.Log.d("Nity", "-5.5");
final_recv.setText(final_value);
- android.util.Log.d("Nity", "-6");
}
});
- android.util.Log.d("Nity", "7");
`}
fun enabled: Bool in "Java" `{ return recv.isEnabled(); `}
# limitations under the License.
# The Application Kit provides services to create GUI
-module app_kit is c_linker_option "-framework AppKit"
+module app_kit is ldflags "-framework AppKit"
import foundation
#
# This wrapper of the Cocoa API regroups the Foundation Kit and the
# Application Kit.
-module cocoa is c_linker_option "-framework Cocoa"
+module cocoa is ldflags "-framework Cocoa"
import foundation
import app_kit
# limitations under the License.
# The Foundation Kit provides basic Objective-C classes and structures
-module foundation is c_linker_option "-framework Foundation"
+module foundation is ldflags "-framework Foundation"
in "ObjC Header" `{
#import <Foundation/Foundation.h>
# Offers features to interface with C++ code and libraries
module cpp is
- new_annotation cpp_compiler_option
+ new_annotation cppflags
end
# A pointer to a C++ std::string instance
# Load the json object from Github.
# See `GithubEntity::load_from_github`.
- private fun load_from_github(key: String): JsonObject do
+ protected fun load_from_github(key: String): JsonObject do
message(1, "Get {key} (github)")
var res = get(key)
if was_error then return new JsonObject
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Enable caching on Github API accesses.
+#
+# If `GithubAPI::enable_cache` is set to true then Github JSON responses
+# will be cached locally using `JsonStore`.
+#
+# Cache can be used to limit the number of access on the API and lighten
+# the rate limit on your github key.
+#
+# Usage:
+#
+# ~~~
+# var api = new GithubAPI(get_github_oauth)
+# api.enable_cache = true
+#
+# var name = "privat/nit"
+# assert not api.has_cache(name)
+# var repo = api.load_repo(name) # load from GitHub
+# assert api.has_cache(name)
+# repo = api.load_repo(name) # load from cache
+#
+# api.clear_cache
+# assert not api.has_cache(name)
+# ~~~
+module cache
+
+intrude import github::api
+import json::store
+
+redef class GithubAPI
+
+ # Enable caching for this client.
+ # Default is `false`.
+ var enable_cache = false is writable
+
+ # JsonStore used to cache data.
+ #
+ # Default directory is `".github_data/"`.
+ var store = new JsonStore(".github_data/") is writable, lazy
+
+ # Delete the cache directory.
+ fun clear_cache do store.clear
+
+ # If no cache data is found for `key` then json is loaded from Github API.
+ redef fun load_from_github(key) do
+ if not enable_cache then return super
+ if store.has_key(key) then
+ message(1, "Get {key} (cache)")
+ was_error = false
+ return store.load_object(key)
+ end
+ var obj = super
+ if not was_error then cache(key, obj)
+ return obj
+ end
+
+ # Save `json` data in cache under `key`.
+ private fun cache(key: String, json: JsonObject) do
+ message(2, "Cache key {key}")
+ store.store_object(key, json)
+ end
+
+ # Check if a cache file exists for `key`.
+ fun has_cache(key: String): Bool do
+ return store.has_key(key)
+ end
+end
# Github API related features.
module github
-import api
+import cache
# most of JNI functions. You can use it to further customize the behavior
# of your code.
module java is
- c_compiler_option "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
- c_linker_option("-L $(JNI_LIB_PATH) -ljvm")
+ cflags "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
+ ldflags "-L $(JNI_LIB_PATH) -ljvm"
new_annotation extra_java_files
end
#
# See: http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html
module jvm is
- c_compiler_option "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
- c_linker_option "-L $(JNI_LIB_PATH) -ljvm"
+ cflags "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
+ ldflags "-L $(JNI_LIB_PATH) -ljvm"
end
in "C Header" `{
# Since this module is a thin wrapper around OpenMPI, in case of missing
# documentation, you can refer to https://www.open-mpi.org/doc/v1.8/.
module mpi is
- c_compiler_option(exec("mpicc", "-showme:compile"))
- c_linker_option(exec("mpicc", "-showme:link"))
+ cflags exec("mpicc", "-showme:compile")
+ ldflags exec("mpicc", "-showme:link")
end
import c
# Offers some POSIX threads services that are not available on all platforms
module extra is
- c_compiler_option("-pthread")
- c_linker_option("-pthread")
+ cflags "-pthread"
+ ldflags "-pthread"
end
intrude import pthreads
# Main POSIX threads support and intro the classes `Thread`, `Mutex` and `Barrier`
module pthreads is
- c_compiler_option("-pthread")
- c_linker_option("-pthread")
+ cflags "-pthread"
+ ldflags "-pthread"
pkgconfig "bdw-gc"
end
# another product.
# Provides the Clock utility class to keep time of real time flow
-module realtime is c_linker_option("-lrt")
+module realtime is ldflags "-lrt"
in "C header" `{
#ifdef _POSIX_C_SOURCE
# SDL display support (used in Linux for windows and inputes only)
module sdl is
- c_compiler_option(exec("sdl-config", "--cflags"))
- c_linker_option(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
+ cflags exec("sdl-config", "--cflags")
+ ldflags(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf")
end
import mnit_display
# alone: JPG, PNG, TIF, GIT, ICO and much more.
module image is
pkgconfig "sdl2"
- c_linker_option "-lSDL2_image"
+ ldflags "-lSDL2_image"
end
import sdl2
--- /dev/null
+include
+lib
+share
+src
--- /dev/null
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Fetch, configure and build libgc (the Boehm GC) for Android
+#
+# Will produce libgc.a which can be linked to Android NDK applications.
+#
+# The `ndk-build` tool from the Android NDK must be in PATH before
+# invoking this tool. It will be used to guess the path to the NDK.
+#
+# Alternatively, you may define a custom path to the NDK by setting
+# `ANDROID_NDK`.
+
+# If ANDROID_NDK is not set, get it from the path to `ndk-build`
+if test -z "$ANDROID_NDK"; then
+ ndk_build_path=`which ndk-build`
+ if test $? -ne 0; then
+ echo "Error: ndk-build from the Android NDK must be in your PATH"
+ exit 1
+ fi
+
+ ANDROID_NDK=`dirname $ndk_build_path`
+fi
+
+# Get the first platform available (it shouldn't change much, but it may
+# have to be adjusted)
+for platform in `echo $ANDROID_NDK/platforms/android-*/arch-arm`; do
+ SYS_ROOT=$platform
+ break
+done
+
+if test -z "$SYS_ROOT"; then
+ echo "Error: could not an Android platform in the NDK, define ANDROID_NDK to the correct path."
+ exit 1
+fi
+
+# Information on the currently targeted libgc and libatomic_ops source URL
+# These may have to be updated according to server-side changes and newer
+# versions of the Boehm GC.
+libgc_url=http://www.hboehm.info/gc/gc_source/gc-7.4.0.tar.gz
+libgc_dir=gc-7.4.0
+libatomic_ops_url=http://www.hboehm.info/gc/gc_source/libatomic_ops-7.4.0.tar.gz
+libatomic_ops_dir=libatomic_ops-7.4.0
+
+# Absolute installation path
+if expr match "$0" "^/.*"; then
+ install="`dirname "$0"`"
+else
+ install="`pwd`/`dirname "$0"`"
+fi
+
+# Local source directory
+mkdir -p "$install/src"
+cd "$install/src"
+
+# Download libs
+for url in $libgc_url $libatomic_ops_url; do
+ echo "Downloading $url..."
+ curl --progress-bar -o `basename $url` $url || exit 1
+done
+
+if test -d $libgc_dir; then
+ rm -r $libgc_dir
+fi
+
+# Extract
+tar -xzf `basename $libgc_url` || exit 1
+tar -xzf `basename $libatomic_ops_url` || exit 1
+mv $libatomic_ops_dir $libgc_dir/libatomic_ops || exit 1
+
+cd $libgc_dir || exit 1
+
+# Configure for Android
+path="$ANDROID_NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/"
+export CC="$path/arm-linux-androideabi-gcc --sysroot=$SYS_ROOT"
+export CXX="$path/arm-linux-androideabi-g++ --sysroot=$SYS_ROOT"
+export LD="$path/arm-linux-androideabi-ld"
+export AR="$path/arm-linux-androideabi-ar"
+export RANLIB="$path/arm-linux-androideabi-ranlib"
+export STRIP="$path/arm-linux-androideabi-strip"
+export CFLAGS="-DIGNORE_DYNAMIC_LOADING -DPLATFORM_ANDROID -I libatomic_ops/src/"
+export LIBS="-lc -lgcc"
+./configure --host=arm-linux-androideabi --enable-static --disable-shared --prefix="$install" || exit 1
+
+# Compile and install locally
+make install -j 4 || exit 1
git diff --shortstat "$orig".."$cur"
echo "PR"
git log --first-parent "$orig".."$cur" | grep 'Pull-Request: #' | wc -l
+echo "non-merge commits"
+git log --no-merges --oneline "$orig".."$cur" | wc -l
echo "shortlog"
-git shortlog -ens "$orig".."$cur"
+git shortlog -ens --no-merges "$orig".."$cur"
echo log
echo
git log --format="* %s [[!commit %h]]" --first-parent "$orig".."$cur" | tac
nitni_ccu.write_as_nitni(self, v.compiler.modelbuilder.compile_dir)
for file in nitni_ccu.files do
- var f = new ExternCFile(file, c_compiler_options)
+ var f = new ExternCFile(file, cflags)
f.pkgconfigs.add_all pkgconfigs
v.compiler.extern_bodies.add(f)
end
redef fun collect_linker_libs
do
- var s = c_linker_options
+ var s = ldflags
if s.is_empty then return null
var res = new ArraySet[String]
res.add s
end
redef class MModule
- var c_compiler_options = "" is writable
- var c_linker_options = "" is writable
+ var cflags = "" is writable
+ var ldflags = "" is writable
# Additional libraries needed for the compilation
# Will be used with pkg-config
# See the License for the specific language governing permissions and
# limitations under the License.
-# Offers the annotations `c_compiler_option` and `c_linker_option` to specify
+# Offers the annotations `cflags` and `ldflags` to specify
# options for the C compiler directly or indirectly. Differs from the `pkgconfig`
# annotation by the separation of the options between the compiler and linker.
module c_compiler_options
private import annotation
redef class ToolContext
- var c_compiler_options_phase: Phase = new CCompilerOptionsPhase(self, null)
+ var cflags_phase: Phase = new CCompilerOptionsPhase(self, null)
end
private class CCompilerOptionsPhase
super Phase
- fun compiler_annotation_name: String do return "c_compiler_option"
- fun linker_annotation_name: String do return "c_linker_option"
- fun cpp_compiler_annotation_name: String do return "cpp_compiler_option"
+ fun compiler_annotation_name: String do return "cflags"
+ fun linker_annotation_name: String do return "ldflags"
+ fun cpp_compiler_annotation_name: String do return "cppflags"
redef fun process_annotated_node(nmoduledecl, nat)
do
fun process_c_compiler_annotation(mmodule: MModule, opt: String)
do
- mmodule.c_compiler_options = "{mmodule.c_compiler_options} {opt}"
+ mmodule.cflags = "{mmodule.cflags} {opt}"
end
fun process_c_linker_annotation(mmodule: MModule, opt: String)
do
- mmodule.c_linker_options = "{mmodule.c_linker_options} {opt}"
+ mmodule.ldflags = "{mmodule.ldflags} {opt}"
end
fun process_cpp_compiler_annotation(mmodule: MModule, opt: String)
do
- mmodule.cpp_compiler_options = "{mmodule.cpp_compiler_options} {opt}"
+ mmodule.cppflags = "{mmodule.cppflags} {opt}"
end
end
redef class MModule
private var cpp_file: nullable CPPCompilationUnit = null
- var cpp_compiler_options = "" is writable
+ var cppflags = "" is writable
end
class CPPLanguage
mmodule.ffi_files.add(file)
# add linked option to support C++
- mmodule.c_linker_options = "{mmodule.c_linker_options} -lstdc++"
+ mmodule.ldflags = "{mmodule.ldflags} -lstdc++"
end
redef fun compile_callback(callback, mmodule, mainmodule, ecc)
var mmodule: MModule
redef fun makefile_rule_name do return "{filename.basename("")}.o"
- redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cpp_compiler_options} -c {filename.basename("")} -o {filename.basename("")}.o"
+ redef fun makefile_rule_content do return "$(CXX) $(CFLAGS) {mmodule.cppflags} -c {filename.basename("")} -o {filename.basename("")}.o"
redef fun compiles_to_o_file do return true
end
ffi_ccu.write_as_impl(self, compdir)
for filename in ffi_ccu.files do
- var f = new ExternCFile(filename, c_compiler_options)
+ var f = new ExternCFile(filename, cflags)
f.pkgconfigs.add_all pkgconfigs
ffi_files.add(f)
end
# Tell the C compiler where to find jni.h and how to link with libjvm
private fun insert_compiler_options
do
- c_compiler_options = "{c_compiler_options} -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
- c_linker_options = "{c_linker_options} -L $(JNI_LIB_PATH) -ljvm"
+ cflags = "{cflags} -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
+ ldflags = "{ldflags} -L $(JNI_LIB_PATH) -ljvm"
end
# Name of the generated Java class where to store all implementation methods of this module
files.add compdir/c_file
- mmodule.c_linker_options = "{mmodule.c_linker_options} -lobjc"
+ mmodule.ldflags = "{mmodule.ldflags} -lobjc"
return new ExternObjCFile(compdir/c_file, mmodule)
end
no_warning
pkgconfig
-c_compiler_option
-c_linker_option
+cflags
+ldflags
platform
"""
class AndroidPlatform
super Platform
+ redef fun supports_libgc do return true
+
redef fun supports_libunwind do return false
redef fun supports_linker_script do return false
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_CFLAGS := -D ANDROID
+LOCAL_CFLAGS := -D ANDROID -D WITH_LIBGC
LOCAL_MODULE := main
LOCAL_SRC_FILES := \\
{{{cfiles.join(" \\\n")}}}
-LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lz
+LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lz libgc.a
LOCAL_STATIC_LIBRARIES := android_native_app_glue png
include $(BUILD_SHARED_LIBRARY)
toolcontext.exec_and_check(["ln", "-s", "{share_dir}/png/", target_png_dir], "Android project error")
end
+ # Ensure that android-setup-libgc.sh has been executed
+ if not "{share_dir}/libgc/lib".file_exists then
+ toolcontext.exec_and_check(["{share_dir}/libgc/android-setup-libgc.sh"], "Android project error")
+ end
+
+ # Copy GC files
+ toolcontext.exec_and_check(["cp", "{share_dir}/libgc/lib/libgc.a", "{android_project_root}/libgc.a"], "Android project error")
+ toolcontext.exec_and_check(["ln", "-s", "{share_dir}/libgc/include/gc/", "{android_project_root}/jni/nit_compile/gc"], "Android project error")
+
### Link to assets (for mnit and others)
# This will be accessed from `android_project_root`
var assets_dir
# See the License for the specific language governing permissions and
# limitations under the License.
-#alt1# module error_annot_c_compiler_alt1 is c_compiler_option
-#alt2# module error_annot_c_compiler_alt2 is c_compiler_option(foo("llvm-config"))
-#alt3# module error_annot_c_compiler_alt3 is c_compiler_option(foo("llvm-config", "2nd arg"))
-#alt4# module error_annot_c_compiler_alt4 is c_linker_option
-#alt5# module error_annot_c_compiler_alt5 is c_compiler_option(exec("invalid-program"))
-#alt6# module error_annot_c_compiler_alt6 is c_compiler_option(exec)
+#alt1# module error_annot_c_compiler_alt1 is cflags
+#alt2# module error_annot_c_compiler_alt2 is cflags(foo("llvm-config"))
+#alt3# module error_annot_c_compiler_alt3 is cflags(foo("llvm-config", "2nd arg"))
+#alt4# module error_annot_c_compiler_alt4 is ldflags
+#alt5# module error_annot_c_compiler_alt5 is cflags(exec("invalid-program"))
+#alt6# module error_annot_c_compiler_alt6 is cflags(exec)
fun foo `{ printf("nothing...\n"); `}
--- /dev/null
+Door 1: Open
+Door 2: Closed
+Door 3: Closed
+Door 4: Open
+Door 5: Closed
+Door 6: Closed
+Door 7: Closed
+Door 8: Closed
+Door 9: Open
+Door 10: Closed
+Door 11: Closed
+Door 12: Closed
+Door 13: Closed
+Door 14: Closed
+Door 15: Closed
+Door 16: Open
+Door 17: Closed
+Door 18: Closed
+Door 19: Closed
+Door 20: Closed
+Door 21: Closed
+Door 22: Closed
+Door 23: Closed
+Door 24: Closed
+Door 25: Open
+Door 26: Closed
+Door 27: Closed
+Door 28: Closed
+Door 29: Closed
+Door 30: Closed
+Door 31: Closed
+Door 32: Closed
+Door 33: Closed
+Door 34: Closed
+Door 35: Closed
+Door 36: Open
+Door 37: Closed
+Door 38: Closed
+Door 39: Closed
+Door 40: Closed
+Door 41: Closed
+Door 42: Closed
+Door 43: Closed
+Door 44: Closed
+Door 45: Closed
+Door 46: Closed
+Door 47: Closed
+Door 48: Closed
+Door 49: Open
+Door 50: Closed
+Door 51: Closed
+Door 52: Closed
+Door 53: Closed
+Door 54: Closed
+Door 55: Closed
+Door 56: Closed
+Door 57: Closed
+Door 58: Closed
+Door 59: Closed
+Door 60: Closed
+Door 61: Closed
+Door 62: Closed
+Door 63: Closed
+Door 64: Open
+Door 65: Closed
+Door 66: Closed
+Door 67: Closed
+Door 68: Closed
+Door 69: Closed
+Door 70: Closed
+Door 71: Closed
+Door 72: Closed
+Door 73: Closed
+Door 74: Closed
+Door 75: Closed
+Door 76: Closed
+Door 77: Closed
+Door 78: Closed
+Door 79: Closed
+Door 80: Closed
+Door 81: Open
+Door 82: Closed
+Door 83: Closed
+Door 84: Closed
+Door 85: Closed
+Door 86: Closed
+Door 87: Closed
+Door 88: Closed
+Door 89: Closed
+Door 90: Closed
+Door 91: Closed
+Door 92: Closed
+Door 93: Closed
+Door 94: Closed
+Door 95: Closed
+Door 96: Closed
+Door 97: Closed
+Door 98: Closed
+Door 99: Closed
+Door 100: Open
-alt/error_annot_c_compiler_alt1.nit:17,39--55: Syntax error: "c_compiler_option" expects at least one argument.
+alt/error_annot_c_compiler_alt1.nit:17,39--44: Syntax error: "cflags" expects at least one argument.
-alt/error_annot_c_compiler_alt2.nit:18,39--75: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments.
+alt/error_annot_c_compiler_alt2.nit:18,39--64: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments.
-alt/error_annot_c_compiler_alt3.nit:19,39--86: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments.
+alt/error_annot_c_compiler_alt3.nit:19,39--75: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments.
-alt/error_annot_c_compiler_alt4.nit:20,39--53: Syntax error: "c_linker_option" expects at least one argument.
+alt/error_annot_c_compiler_alt4.nit:20,39--45: Syntax error: "ldflags" expects at least one argument.
-alt/error_annot_c_compiler_alt5.nit:21,57--79: Annotation error: Something went wrong executing the argument of annotation "c_compiler_option", make sure the command is valid.
+alt/error_annot_c_compiler_alt5.nit:21,46--68: Annotation error: Something went wrong executing the argument of annotation "cflags", make sure the command is valid.
-alt/error_annot_c_compiler_alt6.nit:22,39--61: Syntax error: "c_compiler_option" accepts only calls to `exec` with the command as arguments.
+alt/error_annot_c_compiler_alt6.nit:22,39--50: Syntax error: "cflags" accepts only calls to `exec` with the command as arguments.
# limitations under the License.
module test_annot_c_compiler is
- c_compiler_option("-I /usr/include")
- c_compiler_option(exec("pkg-config", "--cflags", "sdl"))
- c_linker_option("-lm")
- c_linker_option("-lm", "-L /usr/bin")
+ cflags "-I /usr/include"
+ cflags exec("pkg-config", "--cflags", "sdl")
+ ldflags "-lm"
+ ldflags("-lm", "-L /usr/bin")
end
fun dummy `{ printf("nothing...\n"); `}