-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
* Add the windows demo. * Update README.md.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
project(Hello2D) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif () | ||
|
||
if (MSVC) | ||
add_compile_options("/utf-8") | ||
string(TOLOWER ${MSVC_C_ARCHITECTURE_ID} ARCH) | ||
endif (MSVC) | ||
|
||
if (CMAKE_BUILD_TYPE MATCHES "Debug") | ||
add_definitions(-DDEBUG) | ||
else () | ||
add_definitions(-DNDEBUG) | ||
endif () | ||
|
||
add_definitions(-DNOMINMAX -D_USE_MATH_DEFINES -DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_WARNINGS) | ||
find_library(Bcrypt_LIB Bcrypt) | ||
list(APPEND HELLO_2D_LIBS ${Bcrypt_LIB}) | ||
find_library(ws2_32_LIB ws2_32) | ||
list(APPEND HELLO_2D_LIBS ${ws2_32_LIB}) | ||
find_library(SHCORE_LIB SHCore) | ||
list(APPEND HELLO_2D_LIBS ${SHCORE_LIB}) | ||
file(GLOB ANGLE_LIBS ../vendor/angle/win/${ARCH}/*${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
list(APPEND HELLO_2D_LIBS ${ANGLE_LIBS}) | ||
list(APPEND HELLO_2D_INCLUDES ../vendor/angle/include) | ||
|
||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/libEGL.dll) | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../vendor/angle/win/${ARCH}/libEGL.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/libGLESv2.dll) | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../vendor/angle/win/${ARCH}/libGLESv2.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
if (ARCH STREQUAL "x86") | ||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/zlib.dll) | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../vendor/angle/win/${ARCH}/zlib.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
endif () | ||
|
||
set(TGFX_BUILD_DRAWERS ON) | ||
|
||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ ./tgfx) | ||
|
||
file(GLOB_RECURSE HELLO_2D_SOURCE_FILES src/*.*) | ||
add_executable(Hello2D WIN32 ${HELLO_2D_SOURCE_FILES} app.rc) | ||
target_include_directories(Hello2D PRIVATE ${HELLO_2D_INCLUDES} src) | ||
target_link_libraries(Hello2D tgfx-drawers tgfx ${HELLO_2D_LIBS}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IDI_ICON1 ICON DISCARDABLE "images/tgfx.ico" |