Skip to content

Commit

Permalink
modify cmake release or debug
Browse files Browse the repository at this point in the history
  • Loading branch information
yonielwest committed Feb 22, 2024
1 parent f52da9b commit d236d49
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 31 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/cmake-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Create zip
run: zip -r -j gpupixel_linux_x86_64.zip ${{github.workspace}}/output
working-directory: ${{github.workspace}}/output
run: zip -r gpupixel_linux_x86_64.zip .

- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: gpupixel_linux_x86_64
path: ./gpupixel_linux_x86_64.zip
path: ${{github.workspace}}/output/gpupixel_linux_x86_64.zip

build-macos-clang:
name: macOS (Universal)
Expand All @@ -52,13 +53,14 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Create zip
run: zip -r -j gpupixel_mac_Universal.zip ${{github.workspace}}/output
working-directory: ${{github.workspace}}/output
run: zip -r gpupixel_mac_Universal.zip .

- name: Upload Mac Artifact
uses: actions/upload-artifact@v4
with:
name: gpupixel_mac_Universal
path: ./gpupixel_mac_Universal.zip
path: ${{github.workspace}}/output/gpupixel_mac_Universal.zip


build-ios-clang:
Expand All @@ -78,13 +80,14 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Create zip
run: zip -r -j gpupixel_ios_arm64.zip ${{github.workspace}}/output
working-directory: ${{github.workspace}}/output
run: zip -r gpupixel_ios_arm64.zip .

- name: Upload iOS Artifact
uses: actions/upload-artifact@v4
with:
name: gpupixel_ios_arm64
path: ./gpupixel_ios_arm64.zip
path: ${{github.workspace}}/output/gpupixel_ios_arm64.zip


build-windows-mingw:
Expand Down Expand Up @@ -138,13 +141,14 @@ jobs:
run: ./gradlew :gpupixel:assemble

- name: Create zip
run: zip -r -j gpupixel_android_arm64_v8a_aar.zip ${{github.workspace}}/src/android/java/gpupixel/build/outputs/aar
working-directory: ${{github.workspace}}/src/android/java/gpupixel/build/outputs/aar
run: zip -r gpupixel_android_arm64_v8a_aar.zip .

- name: Upload Android Artifact
uses: actions/upload-artifact@v4
with:
name: gpupixel_android_arm64_v8a_aar
path: ./gpupixel_android_arm64_v8a_aar.zip
path: ${{github.workspace}}/src/android/java/gpupixel/build/outputs/aar/gpupixel_android_arm64_v8a_aar.zip

# Deployment job
deploy:
Expand Down
3 changes: 0 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
SET(APP_PROJECT_NAME "gpupixel_app")
PROJECT(${APP_PROJECT_NAME})

# 定义是否编译 DEBUG 版本(也可以在执行 cmake 指令的时候设置:cmake -DBUILD_DEBUG=ON ..)
SET(BUILD_DEBUG TRUE)

# 引用公用的 cmake 文件
INCLUDE(app)
18 changes: 9 additions & 9 deletions examples/app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/rel
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/release)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/release)

IF(BUILD_DEBUG)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(CMAKE_BUILD_TYPE Debug)
LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG})
SET(APP_RESOURCE_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG})
set(COPY_DST_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG})
ELSE()
else()
SET(CMAKE_BUILD_TYPE Release)
LINK_DIRECTORIES(${CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE})
SET(APP_RESOURCE_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE})
set(COPY_DST_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE})
ENDIF(BUILD_DEBUG)
endif()



Expand Down Expand Up @@ -81,11 +81,11 @@ IF(${CURRENT_OS} STREQUAL "linux")
GL
glfw)

IF(BUILD_DEBUG)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG}/libgpupixel.so)
ELSE()
else()
SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE}/libgpupixel.so)
ENDIF(BUILD_DEBUG)
endif()

FIlE(GLOB VNN_LIBS
${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/vnn/libs/${CURRENT_OS}/*
Expand All @@ -101,11 +101,11 @@ ELSEIF(${CURRENT_OS} STREQUAL "windows")
${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/vnn/libs/${CURRENT_OS}/x64/*
)

IF(BUILD_DEBUG)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG}/libgpupixel.dll)
ELSE()
else()
SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE}/libgpupixel.dll)
ENDIF(BUILD_DEBUG)
endif()
ENDIF()

# copy resource file
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
SET(PROJECT_NAME "gpupixel")
PROJECT(${PROJECT_NAME})

# 定义是否编译 DEBUG 版本(也可以在执行 cmake 指令的时候设置:cmake -DBUILD_DEBUG=ON ..)
SET(BUILD_DEBUG TRUE)

# 定义导出 API 的宏定义(Windows下才有意义)
ADD_DEFINITIONS(-DMYMATH_EXPORT_LIBRARY)

Expand Down
8 changes: 0 additions & 8 deletions src/lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/rel
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/release)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/release)


IF(BUILD_DEBUG)
SET(CMAKE_BUILD_TYPE Debug)
ELSE()
SET(CMAKE_BUILD_TYPE Release)
ENDIF(BUILD_DEBUG)


# Config source and header file
# ---------
# header include path
Expand Down

0 comments on commit d236d49

Please sign in to comment.