Giter VIP home page Giter VIP logo

xmake-io / xmake Goto Github PK

View Code? Open in Web Editor NEW
8.9K 137.0 723.0 34.59 MB

🔥 A cross-platform build utility based on Lua

Home Page: https://xmake.io

License: Apache License 2.0

C 38.06% C++ 9.37% Objective-C 0.35% Assembly 0.27% Makefile 0.02% Lua 50.43% Shell 0.43% NSIS 0.10% D 0.02% Go 0.01% Objective-C++ 0.01% Rust 0.01% Swift 0.05% Perl 0.40% Roff 0.11% Batchfile 0.05% Elixir 0.01% PowerShell 0.12% Cuda 0.19% QML 0.01%
lua build-tool visual-studio xmake package-manager tbox c c-plus-plus objective-c makefile

xmake's Introduction

xmake

A cross-platform build utility based on Lua
Modern C/C++ build tool: Simple, Fast, Powerful dependency package integration

Support this project

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. 🙏

Technical support

You can also consider sponsoring us to get extra technical support services via the Github sponsor program. If you do, you can get access to the xmake-io/technical-support repository, which has the following bennefits:

  • Handling Issues with higher priority
  • One-to-one technical consulting service
  • Review your xmake.lua and provide suggestions for improvement

Introduction (中文)

What is Xmake?

  1. Xmake is a cross-platform build utility based on the Lua scripting language.
  2. Xmake is very lightweight and has no dependencies outside of the standard library.
  3. Uses the xmake.lua file to maintain project builds with a simple and readable syntax.

Xmake can be used to directly build source code (like with Make or Ninja), or it can generate project source files like CMake or Meson. It also has a built-in package management system to help users integrate C/C++ dependencies.

Xmake = Build backend + Project Generator + Package Manager + [Remote|Distributed] Build + Cache

Although less precise, one can still understand Xmake in the following way:

Xmake ≈ Make/Ninja + CMake/Meson + Vcpkg/Conan + distcc + ccache/sccache

If you want to know more, please refer to: the Documentation, GitHub or Gitee. You are also welcome to join our community.

The official Xmake repository can be found at xmake-io/xmake-repo.

Installation

With cURL

curl -fsSL https://xmake.io/shget.text | bash

With Wget

wget https://xmake.io/shget.text -O - | bash

With PowerShell

Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content

Other installation methods

If you don't want to use the above scripts to install Xmake, visit the Installation Guide for other installation methods (building from source, package managers, etc.).

Simple Project Description

target("console")
    set_kind("binary")
    add_files("src/*.c")

Creates a new target console of kind binary, and adds all the files ending in .c in the src directory.

Package dependences

add_requires("tbox 1.6.*", "zlib", "libpng ~1.6")

Adds a requirement of tbox v1.6, zlib (any version), and libpng v1.6.

The official xmake package repository exists at: xmake-repo

Commandline interface reference

The below assumes you are currently in the project's root directory.

Build a project

$ xmake

Run target

$ xmake run console

Debug target

$ xmake run -d console

Run test

$ xmake test

Configure platform

$ xmake f -p [windows|linux|macosx|android|iphoneos ..] -a [x86|arm64 ..] -m [debug|release]
$ xmake

Menu configuration

$ xmake f --menu

Supported platforms

  • Windows (x86, x64, arm64)
  • macOS (i386, x86_64, arm64)
  • Linux (i386, x86_64, arm, arm64, riscv, mips, 390x, sh4 ...)
  • *BSD (i386, x86_64)
  • Android (x86, x86_64, armeabi, armeabi-v7a, arm64-v8a)
  • iOS (armv7, armv7s, arm64, i386, x86_64)
  • WatchOS (armv7k, i386)
  • AppleTVOS (armv7, arm64, i386, x86_64)
  • AppleXROS (arm64, x86_64)
  • MSYS (i386, x86_64)
  • MinGW (i386, x86_64, arm, arm64)
  • Cygwin (i386, x86_64)
  • Wasm (wasm32, wasm64)
  • Haiku (i386, x86_64)
  • Harmony (x86_64, armeabi-v7a, arm64-v8a)
  • Cross (cross-toolchains ..)

Supported toolchains

$ xmake show -l toolchains
xcode         Xcode IDE
msvc          Microsoft Visual C/C++ Compiler
clang-cl      LLVM Clang C/C++ Compiler compatible with msvc
yasm          The Yasm Modular Assembler
clang         A C language family frontend for LLVM
go            Go Programming Language Compiler
dlang         D Programming Language Compiler (Auto)
dmd           D Programming Language Compiler
ldc           The LLVM-based D Compiler
gdc           The GNU D Compiler (GDC)
gfortran      GNU Fortran Programming Language Compiler
zig           Zig Programming Language Compiler
sdcc          Small Device C Compiler
cuda          CUDA Toolkit (nvcc, nvc, nvc++, nvfortran)
ndk           Android NDK
rust          Rust Programming Language Compiler
swift         Swift Programming Language Compiler
llvm          A collection of modular and reusable compiler and toolchain technologies
cross         Common cross compilation toolchain
nasm          NASM Assembler
gcc           GNU Compiler Collection
mingw         Minimalist GNU for Windows
gnu-rm        GNU Arm Embedded Toolchain
envs          Environment variables toolchain
fasm          Flat Assembler
tinycc        Tiny C Compiler
emcc          A toolchain for compiling to asm.js and WebAssembly
icc           Intel C/C++ Compiler
ifort         Intel Fortran Compiler
muslcc        The musl-based cross-compilation toolchain
fpc           Free Pascal Programming Language Compiler
wasi          WASI-enabled WebAssembly C/C++ toolchain
nim           Nim Programming Language Compiler
circle        A new C++20 compiler
armcc         ARM Compiler Version 5 of Keil MDK
armclang      ARM Compiler Version 6 of Keil MDK
c51           Keil development tools for the 8051 Microcontroller Architecture
icx           Intel LLVM C/C++ Compiler
dpcpp         Intel LLVM C++ Compiler for data parallel programming model based on Khronos SYCL
masm32        The MASM32 SDK
iverilog      Icarus Verilog
verilator     Verilator open-source SystemVerilog simulator and lint system
cosmocc       build-once run-anywhere
hdk           Harmony SDK

Supported languages

  • C and C++
  • Objective-C and Objective-C++
  • Swift
  • Assembly
  • Golang
  • Rust
  • Dlang
  • Fortran
  • Cuda
  • Zig
  • Vala
  • Pascal
  • Nim
  • Verilog
  • FASM
  • NASM
  • YASM
  • MASM32
  • Cppfront

Features

Xmake exhibits:

  • Simple yet flexible configuration grammar.
  • Quick, dependency-free installation.
  • Easy compilation for most all supported platforms.
  • Supports cross-compilation with intelligent analysis of cross toolchain information.
  • Extremely fast parallel compilation support.
  • Supports C++ modules (new in C++20).
  • Supports cross-platform C/C++ dependencies with built-in package manager.
  • Multi-language compilation support including mixed-language projects.
  • Rich plug-in support with various project generators (ex. Visual Studio/Makefiles/CMake/compile_commands.json)
  • REPL interactive execution support
  • Incremental compilation support with automatic analysis of header files
  • Built-in toolchain management
  • A large number of expansion modules
  • Remote compilation support
  • Distributed compilation support
  • Local and remote build cache support

Supported Project Types

Xmake supports the below types of projects:

  • Static libraries
  • Shared libraries
  • Console/CLI applications
  • CUDA programs
  • Qt applications
  • WDK drivers (umdf/kmdf/wdm)
  • WinSDK applications
  • MFC applications
  • Darwin applications (with metal support)
  • Frameworks and bundles (in Darwin)
  • SWIG modules (Lua, Python, ...)
  • LuaRocks modules
  • Protobuf programs
  • Lex/Yacc programs
  • Linux kernel modules

Package management

Download and build

Xmake can automatically fetch and install dependencies!

Supported package repositories

  • Official package repository xmake-repo (tbox >1.6.1)
  • Official package manager Xrepo
  • User-built repositories
  • Conan (conan::openssl/1.1.1g)
  • Conda (conda::libpng 1.3.67)
  • Vcpkg (vcpkg:ffmpeg)
  • Homebrew/Linuxbrew (brew::pcre2/libpcre2-8)
  • Pacman on archlinux/msys2 (pacman::libcurl)
  • Apt on ubuntu/debian (apt::zlib1g-dev)
  • Clib (clib::clibs/[email protected])
  • Dub (dub::log 0.4.3)
  • Portage on Gentoo/Linux (portage::libhandy)
  • Nimble for nimlang (nimble::zip >1.3)
  • Cargo for rust (cargo::base64 0.13.0)
  • Zypper on openSUSE (zypper::libsfml2 2.5)

Package management features

  • The official repository provides nearly 500+ packages with simple compilation on all supported platforms
  • Full platform package support, support for cross-compiled dependent packages
  • Support package virtual environment using xrepo env shell
  • Precompiled package acceleration for Windows (NT)
  • Support self-built package repositories and private repository deployment
  • Third-party package repository support for repositories such as: vcpkg, conan, conda, etc.
  • Supports automatic pulling of remote toolchains
  • Supports dependency version locking

Processing architecture

Below is a diagram showing roughly the architecture of Xmake, and thus how it functions.

Distributed Compilation

  • Cross-platform support.
  • Support for MSVC, Clang, GCC and other cross-compilation toolchains.
  • Support for building for Android, Linux, Windows NT, and Darwin hosts.
  • No dependencies other than the compilation toolchain.
  • Support for build server load balancing scheduling.
  • Support for real time compressed transfer of large files (lz4).
  • Almost zero configuration cost, no shared filesystem required, for convenience and security.

For more details see: #274

Remote Compilation

For more details see: #622

Local/Remote Build Cache

For more details see: #622

Benchmark

Xmake's speed on is par with Ninja! The test project: xmake-core

Multi-task parallel compilation

buildsystem Termux (8core/-j12) buildsystem MacOS (8core/-j12)
xmake 24.890s xmake 12.264s
ninja 25.682s ninja 11.327s
cmake(gen+make) 5.416s+28.473s cmake(gen+make) 1.203s+14.030s
cmake(gen+ninja) 4.458s+24.842s cmake(gen+ninja) 0.988s+11.644s

Single task compilation

buildsystem Termux (-j1) buildsystem MacOS (-j1)
xmake 1m57.707s xmake 39.937s
ninja 1m52.845s ninja 38.995s
cmake(gen+make) 5.416s+2m10.539s cmake(gen+make) 1.203s+41.737s
cmake(gen+ninja) 4.458s+1m54.868s cmake(gen+ninja) 0.988s+38.022s

More Examples

Debug and release profiles

add_rules("mode.debug", "mode.release")

target("console")
    set_kind("binary")
    add_files("src/*.c")
    if is_mode("debug") then
        add_defines("DEBUG")
    end

Custom scripts

target("test")
    set_kind("binary")
    add_files("src/*.c")
    after_build(function (target)
        print("hello: %s", target:name())
        os.exec("echo %s", target:targetfile())
    end)

Automatic integration of dependent packages

Download and use packages in xmake-repo or third-party repositories:

add_requires("tbox >1.6.1", "libuv master", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8")
add_requires("conan::openssl/1.1.1g", {alias = "openssl", optional = true, debug = true})
target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_packages("tbox", "libuv", "vcpkg::ffmpeg", "brew::pcre2/libpcre2-8", "openssl")

In addition, we can also use the xrepo command to quickly install dependencies.

Qt QuickApp Program

target("test")
    add_rules("qt.quickapp")
    add_files("src/*.cpp")
    add_files("src/qml.qrc")

Cuda Program

target("test")
    set_kind("binary")
    add_files("src/*.cu")
    add_cugencodes("native")
    add_cugencodes("compute_35")

WDK/UMDF Driver Program

target("echo")
    add_rules("wdk.driver", "wdk.env.umdf")
    add_files("driver/*.c")
    add_files("driver/*.inx")
    add_includedirs("exe")

target("app")
    add_rules("wdk.binary", "wdk.env.umdf")
    add_files("exe/*.cpp")

For more WDK driver examples (UMDF/KMDF/WDM), please visit WDK Program Examples

Darwin Applications

target("test")
    add_rules("xcode.application")
    add_files("src/*.m", "src/**.storyboard", "src/*.xcassets")
    add_files("src/Info.plist")

Framework and Bundle Program (Darwin)

target("test")
    add_rules("xcode.framework") -- or xcode.bundle
    add_files("src/*.m")
    add_files("src/Info.plist")

OpenMP Program

add_requires("libomp", {optional = true})
target("loop")
    set_kind("binary")
    add_files("src/*.cpp")
    add_rules("c++.openmp")
    add_packages("libomp")

Zig Program

target("test")
    set_kind("binary")
    add_files("src/main.zig")

Automatically fetch remote toolchain

fetch a special version of LLVM

Require the Clang version packaged with LLM-10 to compile a project.

add_requires("llvm 10.x", {alias = "llvm-10"})
target("test")
    set_kind("binary")
    add_files("src/*.c")
    set_toolchains("llvm@llvm-10")

Fetch a cross-compilation toolchain

We can also pull a specified cross-compilation toolchain in to compile the project.

add_requires("muslcc")
target("test")
    set_kind("binary")
    add_files("src/*.c")
    set_toolchains("@muslcc")

Fetch toolchain and packages

We can also use the specified muslcc cross-compilation toolchain to compile and integrate all dependent packages.

add_requires("muslcc")
add_requires("zlib", "libogg", {system = false})

set_toolchains("@muslcc")

target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_packages("zlib", "libogg")

Plugins

Generate IDE project file plugin(makefile, vs2002 - vs2022 .. )

$ xmake project -k vsxmake -m "debug,release" # New vsproj generator (Recommended)
$ xmake project -k vs -m "debug,release"
$ xmake project -k cmake
$ xmake project -k ninja
$ xmake project -k compile_commands

Run a custom lua script plugin

$ xmake l ./test.lua
$ xmake l -c "print('hello xmake!')"
$ xmake l lib.detect.find_tool gcc
$ xmake l
> print("hello xmake!")
> {1, 2, 3}
< {
    1,
    2,
    3
  }

To see a list of bultin plugs, please visit Builtin plugins.

Please download and install other plugins from the plugins repository xmake-plugins.

IDE/Editor Integration

Xmake Gradle Plugin (JNI)

We can use the xmake-gradle plugin to compile JNI libraries via gradle.

plugins {
  id 'org.tboox.gradle-xmake-plugin' version '1.1.5'
}

android {
    externalNativeBuild {
        xmake {
            path "jni/xmake.lua"
        }
    }
}

The xmakeBuild task will be injected into the assemble task automatically if the gradle-xmake-plugin has been applied.

$ ./gradlew app:assembleDebug
> Task :nativelib:xmakeConfigureForArm64
> Task :nativelib:xmakeBuildForArm64
>> xmake build
[ 50%]: cache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/arm64-v8a
> Task :nativelib:xmakeConfigureForArmv7
> Task :nativelib:xmakeBuildForArmv7
>> xmake build
[ 50%]: cache compiling.debug nativelib.cc
[ 75%]: linking.debug libnativelib.so
[100%]: build ok!
>> install artifacts to /Users/ruki/projects/personal/xmake-gradle/nativelib/libs/armeabi-v7a
> Task :nativelib:preBuild
> Task :nativelib:assemble
> Task :app:assembleDebug

CI Integration

GitHub Action

The github-action-setup-xmake plugin for GitHub Actions can allow you to use Xmake with minimal efforts if you use GitHub Actions for your CI pipeline.

uses: xmake-io/github-action-setup-xmake@v1
with:
  xmake-version: latest

Who is using Xmake?

The list of people and projects who are using Xmake is available here.

If you are using Xmake, you are welcome to submit your information to the above list through a PR, so that other users and the developers can gauge interest. Ihis also let users to use xmake more confidently and give us motivation to continue to maintain it.

This will help the Xmake project and it's community grow stronger and expand!

Contacts

Thanks

This project exists thanks to all the people who have contributed:

  • TitanSnow: Provide the xmake logo and install scripts
  • uael: Provide the semantic versioning library sv
  • OpportunityLiu: Improve cuda, tests and ci
  • xq144: Improve xrepo env shell, and contribute a lot of packages to the xmake-repo repository.
  • enderger: Helped smooth out the edges on the English translation of the README

xmake's People

Contributors

a2va avatar aacirino avatar arthapz avatar as564335sa avatar c8ef avatar calebkiage avatar charlesseizilles avatar chi-eee avatar cyfdecyf avatar dawnmagnet avatar domain avatar glcraft avatar heheda123123 avatar imperators79 avatar jingkaimori avatar opportunityliu avatar orzuk-lmj avatar phate6660 avatar razer-rbi avatar richardycj avatar rivy avatar ruihe774 avatar shaoxie1986 avatar shuax avatar sirlynix avatar star-hengxing avatar waruqi avatar wsw0108 avatar xigalto avatar xq114 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmake's Issues

Unrecognized option: 'm'

checking for the flags -C opt-level=3 ... ok
rustc -C opt-level=3 -march=armv7-a -llog -mthumb --sysroot=/Users/margin/android/android-ndk-r13b/platforms/android-24/arch-arm -L/Users/margin/android/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -lgnustl_static --crate-type=bin -o build/hello src/main.rs
error: /usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562: /usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562: /usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562: error: Unrecognized option: 'm'.


stack traceback:
    [C]: in function 'error'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562]: in function 'raise'
    [...llar/xmake/2.1.1/share/xmake/core/sandbox/modules/os.lua:230]: in function 'run'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/tools/rustc.lua:123]:
    [C]: in function 'build'
    [...xmake/core/sandbox/modules/import/core/tool/compiler.lua:138]: in function 'build'
    [...r/xmake/2.1.1/share/xmake/actions/build/kinds/binary.lua:96]: in function '_build_from_sources'
    [...r/xmake/2.1.1/share/xmake/actions/build/kinds/binary.lua:117]: in function 'build'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:37]: in function 'script'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:55]: in function '_build_target'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:77]: in function '_build_target_and_deps'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:146]: in function 'build'
    [...al/Cellar/xmake/2.1.1/share/xmake/actions/build/main.lua:73]:
    [C]: in function 'xpcall'
    [...lar/xmake/2.1.1/share/xmake/core/sandbox/modules/try.lua:102]: in function 'try'
    [...al/Cellar/xmake/2.1.1/share/xmake/actions/build/main.lua:69]:
    [C]: in function 'load'
    [...cal/Cellar/xmake/2.1.1/share/xmake/core/project/task.lua:421]: in function 'run'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/core/main.lua:131]:

stack traceback:
    [C]: in function 'error'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562]: in function 'raise'
    [...llar/xmake/2.1.1/share/xmake/core/sandbox/modules/os.lua:393]: in function 'raise'
    [...xmake/core/sandbox/modules/import/core/tool/compiler.lua:140]: in function 'build'
    [...r/xmake/2.1.1/share/xmake/actions/build/kinds/binary.lua:96]: in function '_build_from_sources'
    [...r/xmake/2.1.1/share/xmake/actions/build/kinds/binary.lua:117]: in function 'build'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:37]: in function 'script'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:55]: in function '_build_target'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:77]: in function '_build_target_and_deps'
    [...Cellar/xmake/2.1.1/share/xmake/actions/build/builder.lua:146]: in function 'build'
    [...al/Cellar/xmake/2.1.1/share/xmake/actions/build/main.lua:73]:

stack traceback:
    [C]: in function 'error'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/core/base/os.lua:562]: in function 'raise'
    [...llar/xmake/2.1.1/share/xmake/core/sandbox/modules/os.lua:393]: in function 'raise'
    [...al/Cellar/xmake/2.1.1/share/xmake/actions/build/main.lua:83]: in function 'catch'
    [...lar/xmake/2.1.1/share/xmake/core/sandbox/modules/try.lua:107]: in function 'try'
    [...al/Cellar/xmake/2.1.1/share/xmake/actions/build/main.lua:69]:
    [C]: in function 'load'
    [...cal/Cellar/xmake/2.1.1/share/xmake/core/project/task.lua:421]: in function 'run'
    [/usr/local/Cellar/xmake/2.1.1/share/xmake/core/main.lua:131]:

win7 X64 install无法生成

compile.r os/rmfile.c
compile.r os/setenv.c
compile.r os/strerror.c
compile.r os/tmpdir.c
compile.r path/absolute.c
compile.r path/is_absolute.c
compile.r path/relative.c
compile.r path/translate.c
compile.r string/endswith.c
compile.r string/startswith.c
compile.r xmake.c
link xmaker.lib
make ../demo
compile.r xmake.c
link demo.exe
make.exe[1]: Leaving directory /k/third_party/xmake-master/core' make.exe[1]: Entering directory/k/third_party/xmake-master/core'
install xmake
make xmake
make ../demo
make.exe[4]: Nothing to be done for all'. install xmake install ../demo make.exe[1]: Leaving directory/k/third_party/xmake-master/core'

Linux Building breaks

It seems your upgrade to tbox caused a serious problem.
Log here:

installing to /usr/local ...
plat: linux
arch: x86_64
compiling xmake-core ...
=============================================================================
compile:
plat: linux
arch: x86_64
host: linux
demo: y
prof: n
debug: n
small: n
ccache:
distcc:
packages:
tbox: y
luajit: y
base: y
directories:
install:
package:
toolchains:
bin:
pre:
sdk:
flags:
cflag:
ccflag:
cxflag:
mflag:
mmflag:
mxflag:
ldflag:
asflag:
arflag:
shflag:
clean xmake
clean xmake
clean demo
make xmake
make xmake
compile.r machine.c
compile.r os/chdir.c
compile.r os/cpdir.c
compile.r os/cpfile.c
compile.r os/curdir.c
compile.r os/emptydir.c
compile.r os/exists.c
compile.r os/find.c
compile.r os/getenv.c
compile.r os/isdir.c
compile.r os/isfile.c
compile.r os/mclock.c
compile.r os/mkdir.c
compile.r os/mtime.c
compile.r os/rename.c
compile.r os/rmdir.c
compile.r os/rmfile.c
compile.r os/setenv.c
compile.r os/strerror.c
compile.r os/tmpdir.c
compile.r os/uuid.c
compile.r path/absolute.c
compile.r path/is_absolute.c
compile.r path/relative.c
compile.r path/translate.c
compile.r process/close.c
compile.r process/open.c
compile.r process/openv.c
compile.r process/wait.c
compile.r process/waitlist.c
compile.r string/endswith.c
compile.r string/startswith.c
compile.r string/strcmp.c
compile.r xmake.c
link libxmaker.a
make demo
compile.r xmake.c
link demo.b
/home/darksun/xmake/core/suffix.mak:302: recipe for target 'demo.b' failed
make[2]: *** [demo.b] Error 1
/home/darksun/xmake/core/suffix.mak:303: recipe for target 'SUB_PROS_demo_all' failed
make[1]: *** [SUB_PROS_demo_all] Error 2
makefile:39: recipe for target 'all' failed
make: *** [all] Error 2
output xmake
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(math.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(stdlib.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(printf_object.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(singleton.c.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(trace.c.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(network.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(ipv6.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(server.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(cache.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(remove_if.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(vector.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(mem.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(hash.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(str.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(hash_map.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(mem.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(ptr.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(isqrti.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(path.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(ifaddrs.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(socket.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(directory.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(thread.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(dns.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(uuid.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(random.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(vsnprintf.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(native_allocator.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(data.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(stream.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(url.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(ipaddr.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(ipv4.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(hwaddr.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(heap_sort.c.o): relocation R_X86_64_32 against hidden symbol tb_iterator_comp' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(quick_sort.c.o): relocation R_X86_64_32 against hidden symbol tb_iterator_comp' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(bubble_sort.c.o): relocation R_X86_64_32 against hidden symbol tb_iterator_comp' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(list.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(list_entry.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(hash_set.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(idivi8.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(thread_local.c.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(base64.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(fixed_pool.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(http.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(file.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(sock.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(http.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(method.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(cookies.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(binary_find.c.o): relocation R_X86_64_32 against hidden symbol tb_iterator_comp' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(true.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(single_list_entry.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(addrinfo.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(url.c.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(filter.c.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(chunked.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(cache.c.o): relocation R_X86_64_32S against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(date.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/tbox.pkg/lib/release/linux/x86_64/libtbox.a(size.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_err.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_str.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_debug.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_state.o): relocation R_X86_64_32S against hidden symbol lj_alloc_f' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_dispatch.o): relocation R_X86_64_32S against hidden symbol lj_bc_ofs' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_api.o): relocation R_X86_64_32S against hidden symbol lj_obj_typename' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_lex.o): relocation R_X86_64_32S against hidden symbol lj_char_bits' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_parse.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_load.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_trace.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_ctype.o): relocation R_X86_64_32S against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_ccallback.o): relocation R_X86_64_32S against hidden symbol lj_vm_ffi_callback' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_aux.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_ffi.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_init.o): relocation R_X86_64_32 against symbol luaopen_base' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_gc.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_meta.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_vmevent.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_strscan.o): relocation R_X86_64_32S against hidden symbol lj_char_bits' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_bcread.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_bcwrite.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_ir.o): relocation R_X86_64_32S against hidden symbol lj_ir_callinfo' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_opt_fold.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_opt_dce.o): relocation R_X86_64_32S against hidden symbol lj_ir_mode' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_opt_loop.o): relocation R_X86_64_32S against hidden symbol lj_ir_mode' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_opt_sink.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_mcode.o): relocation R_X86_64_32 against hidden symbol lj_vm_exit_handler' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_snap.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_record.o): relocation R_X86_64_32S against hidden symbol lj_vm_asm_begin' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_ffrecord.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_asm.o): relocation R_X86_64_32S against hidden symbol lj_ir_mode' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_cconv.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_carith.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_clib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_cparse.o): relocation R_X86_64_32S against hidden symbol lj_char_bits' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_lib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_base.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_math.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_bit.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_string.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_table.o): relocation R_X86_64_32S against hidden symbol lj_obj_itypename' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_io.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_os.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_package.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_debug.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lib_jit.o): relocation R_X86_64_32S against hidden symbol lj_ir_callinfo' can not be used when making a shared object
/usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_opt_mem.o): relocation R_X86_64_32S against hidden symbol lj_ir_type_size' can not be used when making a shared object /usr/bin/ld: /home/darksun/xmake/core/pkg/luajit.pkg/lib/release/linux/x86_64/libluajit.a(lj_crecord.o): relocation R_X86_64_32S against hidden symbol lj_ir_type_size' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

xcode 升级到 8 时 出现 找不到sdk

configure ok!
[00%]: compiling.release source/base/binary.c
[03%]: compiling.release source/base/bytebuffer.c
[06%]: compiling.release source/base/string.c
[09%]: compiling.release source/base/tcp.c
error: clang: error: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'

✘  ~●  ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
total 8
drwxr-xr-x 5 root wheel 170 Mar 5 2018 MacOSX.sdk
lrwxr-xr-x 1 root wheel 10 Sep 14 20:25 MacOSX10.12.sdk -> MacOSX.sdk

关于set_languages

刚刚碰到一个坑.....
因为要使用到一个库,C编写的,标准是c99,使用了诸如inline之类的
所以我设置了set_languages("c99"),然后一直链接错误,找不到符号....
翻了一下文档...才发现....
"windows下vs的编译器并不支持按c99的标准来编译c代码,只能支持到c89,但是xmake为了尽可能的支持它,所以在设置c99的标准后,xmake会强制按c++代码模式去编译c代码,从一定程度上解决了windows下编译c99的c代码问题"

然后因为是C库,所以有一个#ifdef __cplusplus extern "C"来检测C++的链接
这样问题就来了....因为使用的C++代码模式,所以导致导出的符号和期望的符号不一致,导致链接错误
去掉extern "C",就没有问题了

我觉得这种情况.....还是应该给一下警告信息........这样排查问题.....方便一些

add_subdirs作用域的问题

在add_subdirs的子工程文件里.....如果没有target,只是add_files..
.这样好像add_files添加的文件,好像因为add_subdirs是全局作用域的原因....会加到所有的target里去...

有没有是target作用域引入子工程,或者子文件,类似require,只单纯包含文件的接口或方法

有问题啊

在windows 安装后,提示找不到xmake_core.exe ?

关于工程依赖的问题

我大致看了一下文档,好像工程依赖,是打包供其它工程调用.
如果我的一个项目有多个工程,多个工程里会有依赖,那要是改动了基础模块,
要看效果,不是要先编译打包基础模块,然后再编译,
不知道xmake是否支持子工程,就是工程1依赖工程2,我改动了工程2,只需要xmake一下工程1,
它会自动编译打包工程2酱紫

在windows下编译使用xmake f -a x64出错

编译环境: windows 10, msvc 2015 update 3

执行以下命令后:
xmake f -a x64
xmake

出错信息如下:
error: build.objs\test1\src\main.cpp.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

原因应该是link用的是x86版本的stdlib而不是x64的, 我看了下在项目目录的.xmake/xmake.conf文件里面的["__vsenv_lib"]的值的是x86的, 并没有更新成x64的, 也就是说执行"xmake f -a x64"命令后, 并没用通过执行"vcvarsall.bat x64"来更新["__vsenv_lib"]的值.

我尝试修改了下xmake安装目录下的platforms/windows/checker.lua文件, 不过问题并没有完全解决:

function _check_vs(config)

        -- checked?
        -- 我目前暂时注释掉了这几行, 但是会使每次编译时都要重新checking一遍
        -- if config.get("vs") and config.get("__vsenv_path") then
        --    return
        -- end

        ... 
        if vs then

            -- get the envname
            local envname = version2envname[vs]

            -- clear vs first
            vs = nil

            -- attempt to check it
            if envname then
                local envalue = os.getenv(envname)
                if envalue and _apply_vs(config, envalue) then
                    vs = version  -- !!! 这里的version并没有定义过 !!!
                end
            end
        end

有考虑过缩减代码库的体积吗?

仓库大约有六七十兆,git clone 都要等很久才能下载完成,如果把 xmake 的下载操作集成在项目构建脚本(如:autogen.sh、build.sh)中的话,估计花在等待 xmake 下载的时间比编译生成整个项目的时间要长,影响别人的使用体验。

粗略的看了下各个目录,主要是下面这个几个目录的占用空间比较多:

core/pkg
core/tool
xmake/packages

这些目录大都是存放已编译好的库和可执行文件,有打算把它们从代码库中抽离出去吗?

比如 core/tool 下的 7zip 的程序,不知道 xmake 是不是要用 7z 压缩格式,如果只是用 zip、gz 之类的压缩文件格式的话,可以考虑用现成的 unzip、tar 命令完成。

能否在mac下生成so文件

我需要在mac下生成一个动态库 手打的命令是这样子的:
gcc -g -O2 -Wall -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup -I../src lsproto.c sproto.c -o sproto.so -L../build
生成出来的文件是:
sproto.so sproto.so.dSYM

但目前用xmake生成出来的是: libsproto.dylib

Follow Windows rules for application configs

On Windows, it's alien to use a dotfile in the home directory (as for xmake, ~/.xmake). A more appropriate place would be %APPDATA%/xmake.

This seems easy to fix. I do hope this will be changed. Thanks!

ArchLinux compilation failed

Haven't tested other Linux Distro. But I cannot manage to compile it on my Manjaro 15.09 or Apricity OS, both are Arch-based.
Here is my error report:

everette  ⋯  C++  tbox  xmake-master  ./install 
compiling xmake-core...
make[3]: *** [demo.b] Error 1
make[2]: *** [SUB_PROS_../demo_all] Error 2
make[1]: *** [SUB_PROS_xmake_all] Error 2
make: *** [all] Error 2
output xmake
../xmake/libxmaker.a(machine.o): In function `xm_machine_init':
machine.c:(.text+0x2): undefined reference to `tb_pool'
machine.c:(.text+0xf): undefined reference to `tb_pool_malloc0_'
machine.c:(.text+0x20): undefined reference to `luaL_newstate'
machine.c:(.text+0x34): undefined reference to `luaL_openlibs'
machine.c:(.text+0x46): undefined reference to `luaL_register'
machine.c:(.text+0x58): undefined reference to `luaL_register'
machine.c:(.text+0x6a): undefined reference to `luaL_register'
machine.c:(.text+0x77): undefined reference to `lua_pushstring'
machine.c:(.text+0x89): undefined reference to `lua_setfield'
machine.c:(.text+0x96): undefined reference to `lua_pushstring'
machine.c:(.text+0xa8): undefined reference to `lua_setfield'
machine.c:(.text+0xb5): undefined reference to `lua_pushstring'
machine.c:(.text+0xc7): undefined reference to `lua_setfield'
machine.c:(.text+0xd3): undefined reference to `lua_createtable'
machine.c:(.text+0xe5): undefined reference to `lua_setfield'
machine.c:(.text+0xf8): undefined reference to `tb_pool'
machine.c:(.text+0x105): undefined reference to `tb_pool_free_'
../xmake/libxmaker.a(machine.o): In function `xm_machine_exit':
machine.c:(.text+0x122): undefined reference to `lua_close'
machine.c:(.text+0x12e): undefined reference to `tb_pool'
../xmake/libxmaker.a(machine.o): In function `xm_machine_main':
machine.c:(.text+0x194): undefined reference to `lua_createtable'
machine.c:(.text+0x1bc): undefined reference to `lua_pushstring'
machine.c:(.text+0x1c9): undefined reference to `lua_objlen'
machine.c:(.text+0x1d9): undefined reference to `lua_rawseti'
machine.c:(.text+0x1fb): undefined reference to `lua_setfield'
machine.c:(.text+0x22a): undefined reference to `tb_environment_get_one'
machine.c:(.text+0x243): undefined reference to `tb_path_absolute'
machine.c:(.text+0x253): undefined reference to `lua_pushstring'
machine.c:(.text+0x265): undefined reference to `lua_setfield'
machine.c:(.text+0x289): undefined reference to `tb_environment_get_one'
machine.c:(.text+0x29a): undefined reference to `tb_printf'
machine.c:(.text+0x2c9): undefined reference to `tb_directory_current'
machine.c:(.text+0x2de): undefined reference to `tb_printf'
machine.c:(.text+0x309): undefined reference to `tb_path_absolute'
machine.c:(.text+0x319): undefined reference to `lua_pushstring'
machine.c:(.text+0x32b): undefined reference to `lua_setfield'
machine.c:(.text+0x338): undefined reference to `tb_strcat'
machine.c:(.text+0x342): undefined reference to `tb_file_info'
machine.c:(.text+0x355): undefined reference to `luaL_loadfile'
machine.c:(.text+0x36e): undefined reference to `lua_pcall'
machine.c:(.text+0x384): undefined reference to `lua_getfield'
machine.c:(.text+0x396): undefined reference to `lua_getfield'
machine.c:(.text+0x3a8): undefined reference to `lua_getfield'
machine.c:(.text+0x3bc): undefined reference to `lua_pcall'
machine.c:(.text+0x3cd): undefined reference to `lua_tonumber'
machine.c:(.text+0x3f3): undefined reference to `lua_tolstring'
machine.c:(.text+0x402): undefined reference to `tb_printf'
machine.c:(.text+0x413): undefined reference to `tb_printf'
../xmake/libxmaker.a(machine.o): In function `xm_machine_exit':
machine.c:(.text+0x13a): undefined reference to `tb_pool_free_'
../xmake/libxmaker.a(chdir.o): In function `xm_os_chdir':
chdir.c:(.text+0x11): undefined reference to `luaL_checklstring'
chdir.c:(.text+0x1e): undefined reference to `tb_directory_current_set'
chdir.c:(.text+0x28): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(cpdir.o): In function `xm_os_cpdir':
cpdir.c:(.text+0x16): undefined reference to `luaL_checklstring'
cpdir.c:(.text+0x28): undefined reference to `luaL_checklstring'
cpdir.c:(.text+0x3d): undefined reference to `tb_directory_copy'
cpdir.c:(.text+0x47): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(cpfile.o): In function `xm_os_cpfile':
cpfile.c:(.text+0x16): undefined reference to `luaL_checklstring'
cpfile.c:(.text+0x28): undefined reference to `luaL_checklstring'
cpfile.c:(.text+0x3d): undefined reference to `tb_file_copy'
cpfile.c:(.text+0x47): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(curdir.o): In function `xm_os_curdir':
curdir.c:(.text+0x1b): undefined reference to `tb_directory_current'
curdir.c:(.text+0x28): undefined reference to `lua_pushnil'
curdir.c:(.text+0x47): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(exists.o): In function `xm_os_exists':
exists.c:(.text+0x11): undefined reference to `luaL_checklstring'
exists.c:(.text+0x20): undefined reference to `tb_file_info'
exists.c:(.text+0x2a): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(find.o): In function `xm_os_find_walk':
find.c:(.text+0x88): undefined reference to `lua_getfield'
find.c:(.text+0x93): undefined reference to `lua_pushstring'
find.c:(.text+0x9e): undefined reference to `lua_pushstring'
find.c:(.text+0xb2): undefined reference to `lua_pcall'
find.c:(.text+0xca): undefined reference to `lua_isstring'
find.c:(.text+0xdd): undefined reference to `lua_tolstring'
find.c:(.text+0xe8): undefined reference to `tb_strcmp'
find.c:(.text+0xfa): undefined reference to `lua_type'
find.c:(.text+0x11e): undefined reference to `lua_rawseti'
find.c:(.text+0x139): undefined reference to `lua_settop'
find.c:(.text+0x153): undefined reference to `lua_tolstring'
find.c:(.text+0x16b): undefined reference to `tb_printf'
find.c:(.text+0x18b): undefined reference to `luaL_checklstring'
find.c:(.text+0x1b9): undefined reference to `lua_objlen'
find.c:(.text+0x1e1): undefined reference to `lua_getfield'
find.c:(.text+0x1ee): undefined reference to `lua_pushstring'
find.c:(.text+0x1f9): undefined reference to `lua_pushstring'
find.c:(.text+0x20d): undefined reference to `lua_pcall'
find.c:(.text+0x225): undefined reference to `lua_isstring'
find.c:(.text+0x23c): undefined reference to `lua_settop'
find.c:(.text+0x249): undefined reference to `lua_settop'
find.c:(.text+0x26b): undefined reference to `lua_rawgeti'
find.c:(.text+0x27a): undefined reference to `lua_tolstring'
find.c:(.text+0x2a0): undefined reference to `lua_tolstring'
find.c:(.text+0x2b0): undefined reference to `tb_strcmp'
find.c:(.text+0x2cf): undefined reference to `lua_tolstring'
find.c:(.text+0x2e6): undefined reference to `tb_printf'
../xmake/libxmaker.a(find.o): In function `xm_os_find':
find.c:(.text+0x310): undefined reference to `luaL_checklstring'
find.c:(.text+0x32b): undefined reference to `luaL_checklstring'
find.c:(.text+0x344): undefined reference to `lua_toboolean'
find.c:(.text+0x354): undefined reference to `lua_toboolean'
find.c:(.text+0x363): undefined reference to `lua_createtable'
find.c:(.text+0x375): undefined reference to `lua_getfield'
find.c:(.text+0x3a4): undefined reference to `tb_directory_walk'
find.c:(.text+0x3b1): undefined reference to `lua_settop'
find.c:(.text+0x3be): undefined reference to `lua_pushinteger'
../xmake/libxmaker.a(isdir.o): In function `xm_os_isdir':
isdir.c:(.text+0x15): undefined reference to `luaL_checklstring'
isdir.c:(.text+0x48): undefined reference to `tb_file_info'
isdir.c:(.text+0x56): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(isfile.o): In function `xm_os_isfile':
isfile.c:(.text+0x15): undefined reference to `luaL_checklstring'
isfile.c:(.text+0x48): undefined reference to `tb_file_info'
isfile.c:(.text+0x56): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(mkdir.o): In function `xm_os_mkdir':
mkdir.c:(.text+0x11): undefined reference to `luaL_checklstring'
mkdir.c:(.text+0x1e): undefined reference to `tb_directory_create'
mkdir.c:(.text+0x28): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(mtime.o): In function `xm_os_mtime':
mtime.c:(.text+0x15): undefined reference to `luaL_checklstring'
mtime.c:(.text+0x48): undefined reference to `tb_file_info'
mtime.c:(.text+0x5d): undefined reference to `lua_pushinteger'
mtime.c:(.text+0x89): undefined reference to `lua_pushinteger'
../xmake/libxmaker.a(rename.o): In function `xm_os_rename':
rename.c:(.text+0x16): undefined reference to `luaL_checklstring'
rename.c:(.text+0x28): undefined reference to `luaL_checklstring'
rename.c:(.text+0x3d): undefined reference to `tb_file_rename'
rename.c:(.text+0x47): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(rmdir.o): In function `xm_os_rmdir':
rmdir.c:(.text+0x11): undefined reference to `luaL_checklstring'
rmdir.c:(.text+0x1e): undefined reference to `tb_directory_remove'
rmdir.c:(.text+0x28): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(rmfile.o): In function `xm_os_rmfile':
rmfile.c:(.text+0x11): undefined reference to `luaL_checklstring'
rmfile.c:(.text+0x1e): undefined reference to `tb_file_remove'
rmfile.c:(.text+0x28): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(setenv.o): In function `xm_os_setenv':
setenv.c:(.text+0x33): undefined reference to `luaL_checklstring'
setenv.c:(.text+0x4d): undefined reference to `luaL_checklstring'
setenv.c:(.text+0x6f): undefined reference to `tb_strchr'
setenv.c:(.text+0x8a): undefined reference to `tb_element_str'
setenv.c:(.text+0x100): undefined reference to `tb_bloom_filter_init'
setenv.c:(.text+0x10c): undefined reference to `tb_environment_init'
setenv.c:(.text+0x146): undefined reference to `tb_strchr'
setenv.c:(.text+0x17e): undefined reference to `tb_strncpy'
setenv.c:(.text+0x197): undefined reference to `tb_bloom_filter_set'
setenv.c:(.text+0x1b1): undefined reference to `tb_environment_set'
setenv.c:(.text+0x1c9): undefined reference to `tb_environment_save'
setenv.c:(.text+0x1d5): undefined reference to `lua_pushboolean'
setenv.c:(.text+0x1dd): undefined reference to `tb_environment_exit'
setenv.c:(.text+0x1ee): undefined reference to `tb_bloom_filter_exit'
setenv.c:(.text+0x22a): undefined reference to `tb_strncpy'
setenv.c:(.text+0x24a): undefined reference to `tb_environment_set'
setenv.c:(.text+0x264): undefined reference to `tb_strchr'
setenv.c:(.text+0x289): undefined reference to `tb_environment_set_one'
setenv.c:(.text+0x295): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(strerror.o): In function `xm_os_strerror':
strerror.c:(.text+0x1c): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(tmpdir.o): In function `xm_os_tmpdir':
tmpdir.c:(.text+0x1b): undefined reference to `tb_directory_temporary'
tmpdir.c:(.text+0x28): undefined reference to `lua_pushnil'
tmpdir.c:(.text+0x47): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(absolute.o): In function `xm_path_absolute':
absolute.c:(.text+0x19): undefined reference to `luaL_checklstring'
absolute.c:(.text+0x34): undefined reference to `luaL_optlstring'
absolute.c:(.text+0x47): undefined reference to `tb_path_absolute_to'
absolute.c:(.text+0x52): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(is_absolute.o): In function `xm_path_is_absolute':
is_absolute.c:(.text+0x11): undefined reference to `luaL_checklstring'
is_absolute.c:(.text+0x1e): undefined reference to `tb_path_is_absolute'
is_absolute.c:(.text+0x28): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(relative.o): In function `xm_path_relative':
relative.c:(.text+0x19): undefined reference to `luaL_checklstring'
relative.c:(.text+0x34): undefined reference to `luaL_optlstring'
relative.c:(.text+0x47): undefined reference to `tb_path_relative_to'
relative.c:(.text+0x52): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(translate.o): In function `xm_path_translate':
translate.c:(.text+0x19): undefined reference to `luaL_checklstring'
translate.c:(.text+0x2e): undefined reference to `tb_strlcpy'
translate.c:(.text+0x3d): undefined reference to `tb_path_translate'
translate.c:(.text+0x51): undefined reference to `lua_pushstring'
../xmake/libxmaker.a(endswith.o): In function `xm_string_endswith':
endswith.c:(.text+0x2e): undefined reference to `luaL_checklstring'
endswith.c:(.text+0x43): undefined reference to `luaL_checklstring'
endswith.c:(.text+0x6e): undefined reference to `tb_strcmp'
endswith.c:(.text+0x7f): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(startswith.o): In function `xm_string_startswith':
startswith.c:(.text+0x1f): undefined reference to `luaL_checklstring'
startswith.c:(.text+0x34): undefined reference to `luaL_checklstring'
startswith.c:(.text+0x4e): undefined reference to `tb_strncmp'
startswith.c:(.text+0x5f): undefined reference to `lua_pushboolean'
../xmake/libxmaker.a(xmake.o): In function `xm_init_':
xmake.c:(.text+0x25): undefined reference to `tb_version'
xmake.c:(.text+0x2d): undefined reference to `tb_used_ptr'
xmake.c:(.text+0x44): undefined reference to `tb_init_'
../xmake/libxmaker.a(xmake.o): In function `xm_version':
xmake.c:(.text+0x8a): undefined reference to `tb_used_ptr'
xmake.c:(.text+0xb2): undefined reference to `tb_s10tou64'
../xmake/libxmaker.a(xmake.o): In function `xm_exit':
xmake.c:(.text+0x71): undefined reference to `tb_exit'
collect2: error: ld returned 1 exit status

Both Chinese and English solutions will be of great help to me, thank you!

关于add_defines和add_defines_if_ok的区别

在option里面使用这个两个命令, 我感觉这两个命令是等效的.

从代码上好像也是等效的? 是在core/tool/compiler.lua的中的_addflags_from_target函数中执行的?

1.如果这两个命令真的是等效的, 是否只保留一个就行了? 同理add_undefines和add_undefines_if_ok也应该是一样的?

2.另外关于add_defines_h_if_ok, 这个命令是在头文件里面定义宏, 然后你在include这个头文件. 那为什么不直接用add_defines定义了, 最后的结果不是一样的吗? 不太明白为什么要生成这个头文件的必要.

run error

ver:2.1.1 sys:win10

error: C:\Program Files (x86)\xmake/core/base/os.lua:562: error in error handling
stack traceback:
        [C]: in function 'error'
        C:\Program Files (x86)\xmake/core/base/os.lua:562: in function 'raise'
        C:\Program Files (x86)\xmake/core/language/language.lua:72: in function 'get'
        C:\Program Files (x86)\xmake/core/language/language.lua:417: in function 'apis'
        C:\Program Files (x86)\xmake/core/project/project.lua:181: in function '_interpreter'
        C:\Program Files (x86)\xmake/core/project/project.lua:481: in function 'tasks'
        C:\Program Files (x86)\xmake/core/project/task.lua:359: in function 'tasks'
        C:\Program Files (x86)\xmake/core/project/task.lua:434: in function 'submenu'
        C:\Program Files (x86)\xmake/core/base/option.lua:44: in function '_translate'
        C:\Program Files (x86)\xmake/core/base/option.lua:189: in function 'init'
        C:\Program Files (x86)\xmake/core/main.lua:111: in function <C:\Program Files (x86)\xmake/core/main.lua:105>

Install failed using Linuxbrew: No such file or directory - output/share/xmake/xmake

I install xmake using https://github.com/Linuxbrew/brew on Arch Linux, here is the error messages:

$ brew install --debug xmake
Updating Homebrew...
/home/guyskk/.linuxbrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/guyskk/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula/xmake.rb
/home/guyskk/.linuxbrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/guyskk/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula/xmake.rb
==> Downloading https://github.com/waruqi/xmake/archive/v2.0.5.tar.gz
Already downloaded: /home/guyskk/.cache/Homebrew/xmake-2.0.5.tar.gz
==> ./install output
/home/guyskk/.linuxbrew/Library/Homebrew/debrew.rb:11:in `raise'
Errno::ENOENT: No such file or directory - output/share/xmake/xmake
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 1
==> Kept temporary files
Temporary files retained at /tmp/xmake-20170116-21478-1qsehl5
Error: No such file or directory - output/share/xmake/xmake
/home/guyskk/.linuxbrew/Library/Homebrew/debrew.rb:11:in `raise'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/pathname.rb:90:in `install_p'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/pathname.rb:84:in `block in install'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/pathname.rb:65:in `each'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/pathname.rb:65:in `install'
/home/guyskk/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula/xmake.rb:18:in `install'
/home/guyskk/.linuxbrew/Library/Homebrew/debrew.rb:22:in `block in install'
/home/guyskk/.linuxbrew/Library/Homebrew/debrew.rb:97:in `debrew'
/home/guyskk/.linuxbrew/Library/Homebrew/debrew.rb:22:in `install'
/home/guyskk/.linuxbrew/Library/Homebrew/build.rb:137:in `block in install'
/home/guyskk/.linuxbrew/Library/Homebrew/formula.rb:1118:in `block in brew'
/home/guyskk/.linuxbrew/Library/Homebrew/formula.rb:1884:in `block in stage'
/home/guyskk/.linuxbrew/Library/Homebrew/resource.rb:98:in `block in unpack'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
/home/guyskk/.linuxbrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
/home/guyskk/.linuxbrew/Library/Homebrew/resource.rb:94:in `unpack'
/home/guyskk/.linuxbrew/Library/Homebrew/resource.rb:86:in `stage'
/home/guyskk/.linuxbrew/Library/Homebrew/formula.rb:1871:in `stage'
/home/guyskk/.linuxbrew/Library/Homebrew/formula.rb:1113:in `brew'
/home/guyskk/.linuxbrew/Library/Homebrew/build.rb:112:in `install'
/home/guyskk/.linuxbrew/Library/Homebrew/build.rb:189:in `<main>'

关于option

高级特性之自定义选项
这里关于option的文档貌似有点问题.....
option函数应该和add_option函数同样的效果用来定义option
要绑定option应该是用set_options吧...

local 变量的问题

local name = "ThirdParty"
local dirs = {
    Box2D = { option = "LightInk3D2D", }, 
}

set_project(name)
set_version("0.0.1")

option("LightInk3D2D")

    set_default(true)

    set_showmenu(true)

    add_defines_if_ok("LightInk3D2D")


local prefixInclude = "../../include/ThirdParty/"
local prefixSrc = "../../src/ThirdParty/"

-- add target
target(name)

    -- set kind
    set_kind("shared")

    add_includedirs(prefixInclude)

    add_options("LightInk3D2D")


    for k, v in ipairs(dirs) do
        if (v.plat and not is_plat(v.plat)) or 
            (v.option and not is_option(v.option))then
            on_build(function()
                print(string.format("subdirs = %s, must plat = %s, option = %s", k, v.plat, v.option))
            end)
        else
            add_subdirs(k)
            on_build(function()
                print(string.format("add sub dir %s", k))
            end)
        end
    end

    on_build(function()
        print(name)
        for k, v in ipairs(dirs) do
            print(k)
        end
        print(#dirs)
    end)

name变量可以访问,但是dirs好像访问不了

xmake 使用的编译器和环境变量设定的编译器不一致

linux 下
export CXX=clang++
export CC=clang

xmake c
configure
{
ex = "ar"
, arch = "x86_64"
, ccache = "ccache"
, host = "linux"
, ld = "g++"
, mode = "debug"
, sh = "g++"
, cc = "gcc"
, ar = "ar"
, cxx = "g++"
, kind = "static"
, buildir = "build"
, CppUTest = false
, as = "gcc"
, plat = "linux"
}

mac下 设置gcc, 出来的结果是clang

assertion failed

[00%]: compiling.debug ....\src\ThirdParty\SDL\SDL.c
[07%]: compiling.debug ....\src\ThirdParty\SDL\SDL_assert_c.h
error: assertion failed!

这个错误不知道是什么引起的....没有更多的信息

Please consider a new API get_objectname

Last time I created the pull request,but I got an unpassed test with the first commit by travis because of the test merge_object.
xmake.lua of this project uses following way to add the built object file into a new target:
add_files("build/.objs/merge_object/src/interface.c.o")
I think it's dangerous and it will make building across different versions of xmake incompatible.And common users don't know it unless they look into build folder.
My thought:Add a new API get_objectname.It receives two arguments,target and source file.For above example,this statement should be replaced with:
add_files(getobjectname("merge_object","interface.c"))
I hope to have a discussion to make it easier to use ;) .

main 重复 编译冲突 只是 提示

[00%]: compiling.release src/Tutorial/tutorial.cxx
error: /usr/local/Cellar/xmake/2.0.3/share/xmake/core/base/os.lua:457: assertion failed!
stack traceback:
[C]: in function 'error'
[/usr/local/Cellar/xmake/2.0.3/share/xmake/core/base/os.lua:457]: in function 'raise'
[...llar/xmake/2.0.3/share/xmake/core/sandbox/modules/os.lua:363]: in function 'raise'
[...ake/2.0.3/share/xmake/core/sandbox/modules/coroutine.lua:57]: in function 'resume'
[...r/xmake/2.0.3/share/xmake/actions/build/kinds/object.lua:251]: in function 'buildall'
[...r/xmake/2.0.3/share/xmake/actions/build/kinds/binary.lua:32]: in function 'build'
[...Cellar/xmake/2.0.3/share/xmake/actions/build/builder.lua:35]: in function 'script'
[...Cellar/xmake/2.0.3/share/xmake/actions/build/builder.lua:53]: in function '_build_target'
[...Cellar/xmake/2.0.3/share/xmake/actions/build/builder.lua:75]: in function '_build_target_and_deps'
[...Cellar/xmake/2.0.3/share/xmake/actions/build/builder.lua:144]: in function 'build'
[...al/Cellar/xmake/2.0.3/share/xmake/actions/build/main.lua:67]:

win7 64位下 install.bat 执行到某一步后不再进行..安装不成功

以下为log:
compile:
    plat:       msvc
    arch:       x86
    host:       msys
    demo:       y
    prof:       n
    debug:      n
    small:      n
    ccache:     
    distcc:     
packages:
    tbox:       y
    luajit:     y
    base:       y
directories:
    install:        
    package:        
toolchains:
    bin:        
    pre:        
    sdk:        
flags:
    cflag:      
    ccflag:     
    cxflag:     
    mflag:      
    mmflag:     
    mxflag:     
    ldflag:     
    asflag:     
    arflag:     
    shflag:     
make.exe[1]: Entering directory `/f/Msys2/home/EvilSay/xmake/core'
clean xmake
clean xmake
clean ../demo
make.exe[1]: Leaving directory `/f/Msys2/home/EvilSay/xmake/core'
make.exe[1]: Entering directory `/f/Msys2/home/EvilSay/xmake/core'
make xmake
make xmake
compile.r machine.c
compile.r os/chdir.c
compile.r os/cpdir.c
compile.r os/cpfile.c
compile.r os/curdir.c
compile.r os/exists.c
compile.r os/find.c
compile.r os/isdir.c
compile.r os/isfile.c
compile.r os/mkdir.c
compile.r os/mtime.c
compile.r os/rename.c
compile.r os/rmdir.c
compile.r os/rmfile.c
compile.r os/setenv.c
compile.r os/strerror.c
compile.r os/tmpdir.c
compile.r path/absolute.c
compile.r path/is_absolute.c
compile.r path/relative.c
compile.r path/translate.c
compile.r string/endswith.c
compile.r string/startswith.c
compile.r xmake.c
link xmaker.lib
make ../demo
compile.r xmake.c
link demo.exe
make.exe[1]: Leaving directory `/f/Msys2/home/EvilSay/xmake/core'
make.exe[1]: Entering directory `/f/Msys2/home/EvilSay/xmake/core'
install xmake
make xmake
make ../demo
make.exe[4]: Nothing to be done for `all'.
install xmake
install ../demo
make.exe[1]: Leaving directory `/f/Msys2/home/EvilSay/xmake/core'
F:\Msys2\home\EvilSay\xmake\core>

追了几个bat没找到原因呢...C:\Program Files\xmake 文件夹创建成功,无权限问题..

请问 如何获取环境变量?

我使用
local os = require('os')
print(os.getenv("HOME"))

总是提示
error: /usr/local/Cellar/xmake/2.0.3/share/xmake/core/base/os.lua:457: /Users/bailong/github/long/xmake-cpputest/xmake.lua:7: attempt to call global 'require' (a nil value)
stack traceback:
[/Users/bailong/github/long/xmake-cpputest/xmake.lua:7]: in main chunk

stack traceback:
[C]: in function 'error'
/usr/local/Cellar/xmake/2.0.3/share/xmake/core/base/os.lua:457: in function 'raise'
...cal/Cellar/xmake/2.0.3/share/xmake/core/project/task.lua:364: in function 'tasks'
...cal/Cellar/xmake/2.0.3/share/xmake/core/project/task.lua:407: in function 'submenu'
...ocal/Cellar/xmake/2.0.3/share/xmake/core/base/option.lua:42: in function '_translate'
...ocal/Cellar/xmake/2.0.3/share/xmake/core/base/option.lua:182: in function 'init'
/usr/local/Cellar/xmake/2.0.3/share/xmake/core/main.lua:112: in function </usr/local/Cellar/xmake/2.0.3/share/xmake/core/main.lua:103>

关于xmake命令生成.make目录的问题

现在的情况是, 如果你在某目录下使用xmake的任何命令(比如说xmake --help), 即使这个目录里面没有xmake.lua, 也会生成.xmake目录, 这样到处生成.make目录很难看, 所以我建议修改如下:

core/main.lua

function main.done()

    -- start profiling
--    profiler:start()

    -- init
    main._init()

    -- init option
    if not option.init(menu) then
        return -1
    end

    **删除这里的**
    - -- save command lines to history
    - history.save("cmdlines", option.cmdline())

    -- run help?
    if main._help() then
        return 0
    end

    -- run task
    local ok, errors = task.run(option.taskname() or "build")
    if not ok then
        utils.error(errors)
        return -1
    end

    **添加到这里**
    + -- save command lines to history
    + history.save("cmdlines", option.cmdline())

    -- dump deprecated entries
    deprecated.dump()

    -- stop profiling
--    profiler:stop()

    -- ok
    return 0
end

是否有考虑打包成单文件

是否有考虑打包成单文件运行或者将[.lua]文件打包成一个文件

我把xmake放在跟随项目,这样方便版本维护和更新我自己写的插件,但是xmake的.lua文件比我项目的文件还多, 虽然不影响什么东西,但是对项目的管理还是比较不好的

couldn't self-build

~/xmake/core$ xmake
error: /usr/local/share/xmake/core/base/option.lua:94: assertion failed!
stack traceback:
	[C]: in function 'assert'
	/usr/local/share/xmake/core/base/option.lua:94: in function '_context'
	/usr/local/share/xmake/core/base/option.lua:787: in function 'options'
	/usr/local/share/xmake/core/base/option.lua:745: in function 'get'
	/usr/local/share/xmake/core/base/utils.lua:37: in function '_print'
	/usr/local/share/xmake/core/base/utils.lua:78: in function 'cprint'
	/usr/local/share/xmake/core/base/utils.lua:118: in function 'error'
	/usr/local/share/xmake/core/main.lua:113: in function </usr/local/share/xmake/core/main.lua:105>

Is there any other work needed to do to self-build?

如何添加编译参数 -Wl,-subsystem,windows

编译GUI程序中,可以在cmake中通过 target_link_libraries(simple xxx -Wl,-subsystem,windows) 来隐藏console窗口。但在xmake 中我试了add_ldflags不行,请问如何才能有效的加上这些参数。

引入汇编

本来可以用内联汇编的,但是64位windows不支持内联汇编
不知道有没有什么办法解决

生成vs工程的问题

使用
xmake project --kind=vs2012
会报错:
configure ok!
error: attempt to index global 'version' (a nil value)

vs2008,vs2012,vs2015都正常
只有vs2010和vs2012会报错,工程文件倒是生成了,但是vcxproj.filters文件是空的

"add_headers" generate header files with executable permission

My xmake.lua is:

-- something else --
target("bg")
    set_options("default")
    set_kind("$(kind)")
    add_files("src/bigint.cpp")
    add_headers("src/bigint.h")    -- HERE "add_headers"
    add_defines("BIGINT_FFT_TRIGGER=0x1000000")
target_end()

src/bigint.h is with normal permission, -rw-r--r--, aka 100644 in git.

After building I got build/bigint.h but it is with executable permission, -rwxr-xr-x, aka 100755 in git.

Why the permission has been changed? I do not think header files should be executable. Or it has its special meanings?

The whole repository can be seen at TitanSnow/libBG:xmake

打印消息

有没有能够打印消息的接口啊
就类似cmake的MESSAGE
我用print的话....会输出多次消息,而且并不能输出内建变量

路径反斜杠问题

在mingw和cmd下,生成出来的makefile的路径分隔符是反斜杠。

@gcc -c -fvisibility=hidden -O3 -m32 -o build\.objs\xm\src\main.o src\main.c > build\.build.log 2>&1

makefile中SHELL,使用的是mingw/msys 下的sh.exe.
sh.exe不支持路径分隔符为反斜杠,导致编译失败

编译过程中的警告只有在出现错误的时候才一起输出

按理来说,编译过程中如果编译器有输出警告会直接显示才对,但实际运行 xmake 时,这个编译警告只有在编译报错时才一起显示出来,有什么办法可以让编译器警告信息即时显示出来?

话说,错误信息全是红色的看起来不顺眼,有办法取消红色吗?

指定工程文件构建的问题

C:\Users\Administrator\Desktop\temp>xmake -F testxmake/xmake.lua
error: null

C:\Users\Administrator\Desktop\temp>cd testxmake

C:\Users\Administrator\Desktop\temp\testxmake>xmake -F xmake.lua
configure ok!

C:\Users\Administrator\Desktop\temp>xmake -F testxmake/sharedtest/xmake.lua
configure ok!

testxmake/xmake.lua内容是:
add_subdirs("sharedtest")

还有一个问题,是我在编写多个工程的时候老是遇到目录的问题,因为我用add_subdirs添加了多个目录,加上我是把源码和工程文件分开的,所以更容易遇到目录的问题
不知道有没有办法指定构建的根目录呢

Support clang with c++11?

I tried clang to build my project. which uses some c++11 futures.
Command is like this:xmake f --cc="clang" --cxx="clang++"
But I failed,I looked through the verbose log and found the c++11 flag was disabled and it gave following reasons.
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
But I am sure that the current file is a cpp source.
So,does xmake support clang with c++11?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.