浏览代码

Avoid architecture selection on gcc, use correct gcc version instead

Review raylib resource file for DLL compilation
raysan5 5 年之前
父节点
当前提交
b499b50154
共有 3 个文件被更改,包括 5 次插入16 次删除
  1. 5 16
      src/Makefile
  2. 二进制
      src/raylib.dll.rc.data
  3. 二进制
      src/raylib.rc.data

+ 5 - 16
src/Makefile

@@ -58,12 +58,12 @@ RAYLIB_LIBTYPE       ?= STATIC
 # Build mode for library: DEBUG or RELEASE
 # Build mode for library: DEBUG or RELEASE
 RAYLIB_BUILD_MODE    ?= RELEASE
 RAYLIB_BUILD_MODE    ?= RELEASE
 
 
-# Build architecture (x86: 32bit or x64: 64bit)
-RAYLIB_BUILD_ARCH    ?= x86
-
 # Build output name for the library
 # Build output name for the library
 RAYLIB_LIB_NAME      ?= raylib
 RAYLIB_LIB_NAME      ?= raylib
 
 
+# Define resource file for DLL properties
+RAYLIB_RES_FILE      ?= ./raylib.dll.rc.data
+
 # Define raylib platform
 # Define raylib platform
 # Options:  PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
 # Options:  PLATFORM_DESKTOP, PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
 PLATFORM             ?= PLATFORM_DESKTOP
 PLATFORM             ?= PLATFORM_DESKTOP
@@ -260,17 +260,6 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID)
     endif
     endif
 endif
 endif
 
 
-# GCC could support multilib building for x86 (-m32) and x64 (-m64)
-ifeq ($(CC), gcc)
-    CFLAGS += -m32
-    LDFLAGS += -m32
-    ifeq ($(RAYLIB_BUILD_ARCH),x64)
-        CFLAGS += -m64
-        LDFLAGS += -m64
-    endif
-endif
-
-
 # Define compiler flags:
 # Define compiler flags:
 #  -O1                      defines optimization level
 #  -O1                      defines optimization level
 #  -g                       include debug information on compilation
 #  -g                       include debug information on compilation
@@ -484,8 +473,8 @@ else
     ifeq ($(RAYLIB_LIBTYPE),SHARED)
     ifeq ($(RAYLIB_LIBTYPE),SHARED)
         ifeq ($(PLATFORM),PLATFORM_DESKTOP)
         ifeq ($(PLATFORM),PLATFORM_DESKTOP)
             ifeq ($(PLATFORM_OS),WINDOWS)
             ifeq ($(PLATFORM_OS),WINDOWS)
-                # TODO: Compile resource file raylib.dll.rc for linkage on raylib.dll generation
-				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/$(RAYLIB_LIB_NAME).dll $(OBJS) $(LDFLAGS) -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
+                # NOTE: Linking with provided resource file
+				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/$(RAYLIB_LIB_NAME).dll $(OBJS) $(RAYLIB_RES_FILE) $(LDFLAGS) -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
 				@echo "raylib dynamic library ($(RAYLIB_LIB_NAME).dll) and import library (lib$(RAYLIB_LIB_NAME)dll.a) generated!"
 				@echo "raylib dynamic library ($(RAYLIB_LIB_NAME).dll) and import library (lib$(RAYLIB_LIB_NAME)dll.a) generated!"
             endif
             endif
             ifeq ($(PLATFORM_OS),LINUX)
             ifeq ($(PLATFORM_OS),LINUX)

二进制
src/raylib.dll.rc.data


二进制
src/raylib.rc.data