Skip to content

Commit

Permalink
Merge pull request #87 from pixpark/dev
Browse files Browse the repository at this point in the history
fix win link error
  • Loading branch information
gezhaoyou authored Jul 26, 2024
2 parents 81243ea + 4088952 commit cd9ba9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FILE(GLOB SOURCE_FILES
IF(${CURRENT_OS} STREQUAL "windows") # windows
# link libs find path
LINK_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/glfw/lib-msvc)
${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/glfw/lib-mingw-w64)

# Source
FILE(GLOB GLAD_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/glad/src/*.c")
Expand Down
7 changes: 4 additions & 3 deletions src/lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ endif()


# Add platform source and header and lib link search path
IF(${CURRENT_OS} STREQUAL "windows") # windows
IF(${CURRENT_OS} STREQUAL "windows")
set(CMAKE_SHARED_LIBRARY_PREFIX "") # windows
# Source
FILE(GLOB GLAD_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glad/src/*.c" )
list(APPEND SOURCE_FILES ${GLAD_SOURCE_FILE})

# link libs find path
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/third_party/glfw/lib-msvc)
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/third_party/glfw/lib-mingw-w64)
ELSEIF(${CURRENT_OS} STREQUAL "linux" OR ${CURRENT_OS} STREQUAL "wasm")
# Source
FILE(GLOB GLAD_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glad/src/*.c" )
Expand Down Expand Up @@ -120,7 +121,7 @@ ENDIF()
# ----------
# build shared or static lib
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${RESOURCE_FILES})

# set platform project
IF(${CURRENT_OS} STREQUAL "linux")
# 设置要构建的目标库的名称和类型
Expand Down

0 comments on commit cd9ba9e

Please sign in to comment.