diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1238a8a..69e51c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,18 @@ cmake_minimum_required(VERSION 3.16) project(demo64k LANGUAGES C CXX) +if(APPLE) + add_definitions(-DGLFW_EXPOSE_NATIVE_COCOA) +elseif(WIN32) + add_definitions(-DGLFW_EXPOSE_NATIVE_WIN32) +elseif(UNIX) + if(DEFINED CMAKE_USE_WAYLAND) + add_definitions(-DGLFW_EXPOSE_NATIVE_WAYLAND) + else() + add_definitions(-DGLFW_EXPOSE_NATIVE_X11) + endif() +endif() + option(DEMO_SIZE_OPT "Enable size optimization flags" OFF) option(DEMO_STRIP_ALL "Strip all unnecessary code for final build" OFF) @@ -29,7 +41,11 @@ set(DEMO_LIBS glfw ${WGPU_LIBRARY}) # Platform-specific dependencies if (APPLE) - set_source_files_properties(src/platform.cc PROPERTIES COMPILE_FLAGS "-x objective-c++") + set_source_files_properties( + src/platform.cc + third_party/glfw3webgpu/glfw3webgpu.c + PROPERTIES COMPILE_FLAGS "-x objective-c++" + ) list(APPEND DEMO_LIBS "-framework Metal" "-framework Foundation" |
