Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed Jun 1, 2024
1 parent ae4fbac commit 3aad264
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ jobs:
- name: Build
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=ON -DBUILD_WITH_ALL=ON ..
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON -DBUILD_SOKOL=ON ..
cmake --build . --config MinSizeRel --parallel
- name: Deploy
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
- name: Build
run: |
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-28 ..
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-28 ..
- name: Deploy
uses: actions/upload-artifact@v4
Expand Down
13 changes: 3 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,11 @@ if (BUILD_NO_OPTIMIZATION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
else()
if(EMSCRIPTEN)
elseif(APPLE)
if(APPLE)
set(LINKER_FLAGS_MINSIZEREL "-Wl,-dead_strip")
elseif(MINGW)
set(FLAGS_MINSIZEREL "-fno-function-sections -fno-data-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions")
set(LINKER_FLAGS_MINSIZEREL "-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} ${LINKER_FLAGS_MINSIZEREL}")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} ${LINKER_FLAGS_MINSIZEREL}")
endif()

set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${FLAGS_MINSIZEREL}")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} ${LINKER_FLAGS_MINSIZEREL}")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} ${LINKER_FLAGS_MINSIZEREL}")
endif()

if (BUILD_ASAN_DEBUG)
Expand Down
4 changes: 2 additions & 2 deletions cmake/sokol.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ if(BUILD_SOKOL)
target_compile_definitions(sokol PRIVATE SOKOL_D3D11)
target_link_libraries(sokol PRIVATE D3D11)
elseif(LINUX)
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33)
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE)
target_link_libraries(sokol PRIVATE X11 GL m dl asound)
elseif(ANDROID)
target_compile_definitions(sokol PRIVATE SOKOL_GLES3)
target_link_libraries(sokol PRIVATE android log aaudio EGL GLESv2 GLESv3)
elseif(EMSCRIPTEN)
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33)
target_compile_definitions(sokol PRIVATE SOKOL_GLES3)
endif()

target_include_directories(sokol PRIVATE ${THIRDPARTY_DIR}/sokol)
Expand Down

0 comments on commit 3aad264

Please sign in to comment.