GithubHelp home page GithubHelp logo

msylvia / libtcc-cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alex2804/libtcc-cmake

0.0 1.0 0.0 2.23 MB

Aims to build libtcc (https://bellard.org/tcc/) platform independent (for supported platforms) with CMake.

License: GNU Lesser General Public License v2.1

CMake 0.52% C 92.56% C++ 6.78% Assembly 0.14%

libtcc-cmake's Introduction

Libtcc

This Project aims to build libtcc for supported platforms system independent with CMake.

Usage

You can embed this CMake project as a subdirectory or build it as every other CMake script.

Make sure that you change the CMake variables according to your needs.

Supported and Tested Platforms

the library was tested with the following operating systems and architectures:

  • Linux
    • x86
    • x86_64
    • armeabi with Hardfloat (tested ARMv7a)
    • aarch64 (arm64)
  • Android (look here for a small demo)
    • x86
    • x86_64
    • armeabi (with Hardfloat, tested ARMv7a, take a look at Issues for limitations on this architecture)
    • aarch64 (arm64)
  • Windows
    • x86
    • x86_64
  • MacOS
    • x86_64

Even though RISC-V 64Bit is supported by libtcc, I have no RISC-V 64 Bit device or emulator to test this, yet.

Issues

  • Valgrind indicates a memory leak when memory is allocated in libtcc compiled code and released in the main application (or vice versa). This seems to be a false positive.

  • If you allocate memory in tcc compiled code and free it in the main application, the program crashes if it is compiled with MSVC (The compiler of libtcc itself is negligible, only the compiler of the main application is crucial).

  • On Android ARM (tested ARMv7 but should be the case for most/all arm architectures less than or equal ARMv7) double argument passing from libtcc compiled code to other code (or vice versa) (e.g. the main application or c standard library) is not working.
    (especially ARMv8 (aarch64/arm64) is not affected by this!)

There is an extension to compile libtcc1.a at runtime. You can enable or disable the extension with LIBTCC_ENABLE_EXTENSION.
For more information like CMake variables look here.


CMake Variables

Possible Values:

  • TRUE
  • FALSE (Default)

Enables or disables the unit tests.


Possible Values:

  • SHARED
  • STATIC (Default)

Defines if the Library should be static or shared


Defines the name of the library file. By default this is "libtcc" or "libtcc-(Platform specific postfix)" depending on whether LIBTCC_TARGET_SPECIFIC_NAME is false or true.


Possible Values:

  • TRUE
  • FALSE (Default)

Defines if the target architecture should be contained in the resulting library name (Ignored if LIBTCC_NAME is defined!).


Possible Values:

  • TRUE (Default)
  • FALSE

Defines if the include headers get copied into "LIBTCC_RUNTIME_PATH/include/".


Defines the directory where the runtime files (include headers and source files for libtcc1 if the extension is enabled) get copied (in subdirectories).
By default this is "libtcc/"-
The Path is relative to the binary directory (CMAKE_BINARY_DIR)!


Defines the architecture to build for (should be recognized automatically if not defined).


Possible Values:

  • TRUE (Default)
  • FALSE

Enables the extension.

libtcc-cmake's People

Contributors

alex2804 avatar

Watchers

James Cloos avatar

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.