Skip to content

Commit c599e37

Browse files
committed
CrossPlatform GLFW Native Macro Config in CMake
- The GLFW_NATIVE macros are required for surface creation in the respective systems. - Currently it was hard-coded for windows only. - Added the required macros for linux and macos to remove the error that was in the Logs for vk_surface not created - Also added the __externals folder to gitignore so that it is not detected. Useful when switching branches and experimenting between the older and this version.
1 parent 8187ad9 commit c599e37

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,4 @@ CMakeSettings.json
427427

428428
# Vcpkg Install Directory
429429
vcpkg_installed/
430+
__externals/

CMakePresets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
"GLFW_BUILD_DOCS": "OFF",
2727
"GLFW_BUILD_EXAMPLES": "OFF",
28+
"GLFW_BUILD_WAYLAND": "ON",
2829

2930
"ASSIMP_BUILD_TESTS": "OFF",
3031
"ASSIMP_INSTALL": "OFF",

ZEngine/ZEngine/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,16 @@ target_compile_definitions (zEngineLib
6868

6969
target_link_libraries (zEngineLib PUBLIC imported::ZEngine_External_Dependencies)
7070

71-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
71+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
7272
target_link_libraries (zEngineLib PUBLIC imported::cppwinrt_headers WindowsApp.lib)
73-
target_compile_definitions(zEngineLib PUBLIC NOMINMAX)
73+
target_compile_definitions(zEngineLib PUBLIC NOMINMAX GLFW_EXPOSE_NATIVE_WIN32)
7474
endif()
7575

76-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
76+
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
7777
target_link_libraries(zEngineLib PUBLIC stdc++fs)
7878
target_compile_definitions(zEngineLib PUBLIC GLFW_EXPOSE_NATIVE_WAYLAND)
7979
endif ()
80+
81+
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
82+
target_compile_definitions(zEngineLib PUBLIC GLFW_EXPOSE_NATIVE_COCOA)
83+
endif()

0 commit comments

Comments
 (0)