Skip to content

Commit

Permalink
More WinRT magic.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 17, 2023
1 parent 5df69c0 commit bf8b6a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- { name: Linux, os: ubuntu-latest }
- { name: Windows, os: windows-latest }
- { name: MacOS, os: macos-latest }
steps:
- { name: UWP, os: windows-latest, flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" },
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@v1
Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ cmake_minimum_required(VERSION 3.12.0)
project(SDL_helloworld)

find_package(SDL3 CONFIG REQUIRED)

# WinRT/UWP/WindowsPhone needs a little more magic.
# If you never care about this target, you can delete this block and window-uwp-main.cpp, too.
if(WINDOWS_STORE)
set(EXTRA_SRCS "windows-uwp-main.cpp")
target_compile_definitions(sdl-helloworld PRIVATE "SDL_MAIN_NOIMPL")
set_property(TARGET sdl-helloworld PROPERTY WIN32_EXECUTABLE TRUE)
add_library(main_uwp OBJECT windows-uwp-main.cpp)
target_link_libraries(main_uwp PRIVATE SDL3::Headers)
target_compile_options(main_uwp PRIVATE "/ZW")
set(EXTRA_LIBRARIES main_uwp)
endif()

add_executable(sdl-helloworld
main.c
${EXTRA_SRCS}
)

target_link_libraries(sdl-helloworld PRIVATE SDL3::SDL3-shared)
target_link_libraries(sdl-helloworld PUBLIC SDL3::Headers)
target_link_libraries(sdl-helloworld PUBLIC SDL3::Headers ${EXTRA_LIBRARIES})

0 comments on commit bf8b6a2

Please sign in to comment.