瀏覽代碼

Allow DLL creation using TCC (#2569)

* Fix Undefined Symbol `_ftelli64`

* Add files via upload

* Update raylib.h

* Update raylib.h
pull/2570/head
Audi Nugraha 2 年之前
committed by GitHub
父節點
當前提交
d1aabb3957
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 2 個文件被更改,包括 12 次插入3 次删除
  1. +9
    -3
      src/Makefile
  2. +3
    -0
      src/raylib.h

+ 9
- 3
src/Makefile 查看文件

@ -456,7 +456,9 @@ LDFLAGS = $(CUSTOM_LDFLAGS) -L. -L$(RAYLIB_RELEASE_PATH)
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
LDFLAGS += -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
ifneq ($(CC), tcc)
LDFLAGS += -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
endif
endif endif
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
LDFLAGS += -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) LDFLAGS += -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION)
@ -469,7 +471,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
endif endif
ifeq ($(PLATFORM),PLATFORM_DRM) ifeq ($(PLATFORM),PLATFORM_DRM)
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
@ -490,7 +492,11 @@ endif
#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
LDLIBS = -static-libgcc -lopengl32 -lgdi32 -lwinmm
ifeq ($(CC), tcc)
LDLIBS = -lopengl32 -lgdi32 -lwinmm -lshell32
else
LDLIBS = -static-libgcc -lopengl32 -lgdi32 -lwinmm
endif
endif endif
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt

+ 3
- 0
src/raylib.h 查看文件

@ -86,6 +86,9 @@
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
#if defined(_WIN32) #if defined(_WIN32)
#if defined(BUILD_LIBTYPE_SHARED) #if defined(BUILD_LIBTYPE_SHARED)
#if defined(__TINYC__)
#define __declspec(x) __attribute__((x))
#endif
#define RLAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) #define RLAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
#elif defined(USE_LIBTYPE_SHARED) #elif defined(USE_LIBTYPE_SHARED)
#define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) #define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)

Loading…
取消
儲存