Skip to content

Commit ae4fbac

Browse files
committed
build fix
1 parent cabaf19 commit ae4fbac

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ jobs:
416416
- uses: nttld/setup-ndk@v1
417417
id: setup-ndk
418418
with:
419-
ndk-version: r26e
419+
ndk-version: r26d
420420
add-to-path: false
421421
local-cache: true
422422

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ else()
4141
if(EMSCRIPTEN)
4242
elseif(APPLE)
4343
set(LINKER_FLAGS_MINSIZEREL "-Wl,-dead_strip")
44-
elseif(NOT MSVC)
44+
elseif(MINGW)
4545
set(FLAGS_MINSIZEREL "-fno-function-sections -fno-data-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions")
4646
set(LINKER_FLAGS_MINSIZEREL "-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections")
4747
endif()

cmake/sokol.cmake

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ if(BUILD_SOKOL)
1414

1515
if(APPLE)
1616
target_compile_definitions(sokol PRIVATE SOKOL_METAL)
17-
elseif(WIN32)
18-
target_compile_definitions(sokol PRIVATE SOKOL_D3D11 SOKOL_D3D11_SHADER_COMPILER)
19-
elseif(LINUX)
20-
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33)
21-
endif()
22-
23-
if(APPLE)
2417
target_link_libraries(sokol
2518
"-framework Cocoa"
2619
"-framework QuartzCore"
@@ -29,13 +22,16 @@ if(BUILD_SOKOL)
2922
"-framework AudioToolbox"
3023
)
3124
elseif(WIN32)
32-
target_link_libraries(sokol D3D11)
33-
34-
if(MINGW)
35-
# target_link_libraries(sokol D3dcompiler_47)
36-
endif()
25+
target_compile_definitions(sokol PRIVATE SOKOL_D3D11)
26+
target_link_libraries(sokol PRIVATE D3D11)
3727
elseif(LINUX)
38-
target_link_libraries(sokol X11 GL m dl asound)
28+
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33)
29+
target_link_libraries(sokol PRIVATE X11 GL m dl asound)
30+
elseif(ANDROID)
31+
target_compile_definitions(sokol PRIVATE SOKOL_GLES3)
32+
target_link_libraries(sokol PRIVATE android log aaudio EGL GLESv2 GLESv3)
33+
elseif(EMSCRIPTEN)
34+
target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33)
3935
endif()
4036

4137
target_include_directories(sokol PRIVATE ${THIRDPARTY_DIR}/sokol)

src/system/sokol/sokol.m

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// MIT License
2+
3+
// Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com
4+
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
12+
// The above copyright notice and this permission notice shall be included in all
13+
// copies or substantial portions of the Software.
14+
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
// SOFTWARE.
22+
23+
#define SOKOL_IMPL
24+
25+
#include "sokol.h"

0 commit comments

Comments
 (0)