Skip to content

Commit 2e7fec7

Browse files
committed
Some convenience methods
1 parent c19c626 commit 2e7fec7

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

cmake/yup_standalone.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function (yup_standalone_app)
2929
INITIAL_MEMORY PTHREAD_POOL_SIZE CUSTOM_PLIST CUSTOM_SHELL)
3030
set (multi_value_args
3131
# Globals
32-
DEFINITIONS COMPILE_OPTIONS MODULES LINK_OPTIONS
32+
DEFINITIONS COMPILE_OPTIONS MODULES SOURCES LINK_OPTIONS
3333
# Emscripten
3434
PRELOAD_FILES)
3535

@@ -228,6 +228,10 @@ function (yup_standalone_app)
228228
${additional_libraries}
229229
${YUP_ARG_MODULES})
230230

231+
if (YUP_ARG_SOURCES AND NOT YUP_TARGET_ANDROID)
232+
target_sources (${target_name} PRIVATE ${YUP_ARG_SOURCES})
233+
endif()
234+
231235
# ==== Post build steps, workaround for python*.dll
232236
if ("yup::yup_python" IN_LIST YUP_ARG_MODULES AND YUP_PLATFORM_WINDOWS AND NOT YUP_ENABLE_STATIC_PYTHON_LIBS AND Python_RUNTIME_LIBRARY_RELEASE)
233237
add_custom_command (TARGET ${target_name} POST_BUILD

standalone/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

standalone/app/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ set (YUP_BUILD_EXAMPLES OFF)
1515
set (YUP_BUILD_TESTS OFF)
1616
FetchContent_MakeAvailable(yup)
1717

18+
file (GLOB sources "${CMAKE_CURRENT_LIST_DIR}/*.cpp")
19+
source_group (TREE ${CMAKE_CURRENT_LIST_DIR}/ FILES ${sources})
20+
1821
yup_standalone_app (
1922
TARGET_NAME ${target_name}
2023
TARGET_VERSION ${target_version}
2124
TARGET_IDE_GROUP "MyApp"
2225
TARGET_APP_ID "my.company.${target_name}"
2326
TARGET_APP_NAMESPACE "my.company"
2427
INITIAL_MEMORY 268435456
25-
MODULES yup::yup_gui)
26-
27-
if (NOT YUP_TARGET_ANDROID)
28-
file (GLOB sources "${CMAKE_CURRENT_LIST_DIR}/*.cpp")
29-
source_group (TREE ${CMAKE_CURRENT_LIST_DIR}/ FILES ${sources})
30-
target_sources (${target_name} PRIVATE ${sources})
31-
endif()
28+
MODULES yup::yup_gui
29+
SOURCES ${sources})

0 commit comments

Comments
 (0)