2024-03-23 00:51:46 +08:00
include ( ${ _AX_ROOT } /1k/platforms.cmake )
2024-01-19 20:33:40 +08:00
_1k_deprecated_32bit ( axmol 2.2.0 )
2024-01-02 21:10:28 +08:00
2023-04-02 16:04:19 +08:00
if ( NOT CMAKE_GENERATOR MATCHES "Ninja" )
2022-08-19 19:52:10 +08:00
set ( BUILD_CONFIG_DIR "\$\(Configuration\)/" )
else ( )
set ( BUILD_CONFIG_DIR "" )
2022-05-19 10:54:42 +08:00
endif ( )
2022-08-11 15:41:10 +08:00
function ( ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR )
2023-10-10 22:10:35 +08:00
# stupid: exclude CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG to avoid cmake generate
# .vcxproj with incorrect debug msvc runtime, should be /MDd but got /MD
2023-10-16 20:24:59 +08:00
set ( GLSLCC_OUT_DIR_PROJ "${GLSLCC_OUT_DIR}" )
2023-10-10 22:10:35 +08:00
load_cache ( "${AX_ROOT_DIR}/${AX_PREBUILT_DIR}" EXCLUDE thirdparty_LIB_DEPENDS CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG )
2023-10-16 20:24:59 +08:00
set ( GLSLCC_OUT_DIR_ENGINE ${ GLSLCC_OUT_DIR } )
set ( GLSLCC_OUT_DIR "${GLSLCC_OUT_DIR_PROJ}" CACHE STRING "" FORCE )
unset ( GLSLCC_OUT_DIR_PROJ )
2023-02-24 19:33:26 +08:00
message ( STATUS "AX_ENABLE_MSEDGE_WEBVIEW2=${AX_ENABLE_MSEDGE_WEBVIEW2}" )
message ( STATUS "AX_ENABLE_MFMEDIA=${AX_ENABLE_MFMEDIA}" )
message ( STATUS "AX_ENABLE_EXT_IMGUI=${AX_ENABLE_EXT_IMGUI}" )
2023-09-12 01:06:28 +08:00
message ( STATUS "AX_ENABLE_EXT_INSPECTOR=${AX_ENABLE_EXT_INSPECTOR}" )
2023-02-24 19:33:26 +08:00
message ( STATUS "AX_ENABLE_EXT_FAIRYGUI=${AX_ENABLE_EXT_FAIRYGUI}" )
message ( STATUS "AX_ENABLE_EXT_LIVE2D=${AX_ENABLE_EXT_LIVE2D}" )
message ( STATUS "AX_ENABLE_EXT_GUI=${AX_ENABLE_EXT_GUI}" )
message ( STATUS "AX_ENABLE_EXT_ASSETMANAGER=${AX_ENABLE_EXT_ASSETMANAGER}" )
message ( STATUS "AX_ENABLE_EXT_PARTICLE3D=${AX_ENABLE_EXT_PARTICLE3D}" )
message ( STATUS "AX_ENABLE_EXT_PHYSICS_NODE=${AX_ENABLE_EXT_PHYSICS_NODE}" )
message ( STATUS "AX_ENABLE_EXT_SPINE=${AX_ENABLE_EXT_SPINE}" )
message ( STATUS "AX_ENABLE_EXT_EFFEKSEER=${AX_ENABLE_EXT_EFFEKSEER}" )
message ( STATUS "AX_ENABLE_EXT_LUA=${AX_ENABLE_EXT_LUA}" )
2024-01-05 05:35:05 +08:00
message ( STATUS "AX_ENABLE_EXT_DRAWNODEEX=${AX_ENABLE_EXT_DRAWNODEEX}" )
2023-02-24 19:33:26 +08:00
2023-10-11 00:27:46 +08:00
# compile defines can't inherit when link prebuits, so need add manually
target_compile_definitions ( ${ APP_NAME }
P R I V A T E A X _ G L E S _ P R O F I L E = $ { A X _ G L E S _ P R O F I L E }
P R I V A T E O P E N S S L _ S U P P R E S S _ D E P R E C A T E D = 1
P R I V A T E N O U N C R Y P T = 1
P R I V A T E P 2 T _ S T A T I C _ E X P O R T S = 1
P R I V A T E B T _ U S E _ S S E _ I N _ A P I = 1
P R I V A T E C P _ U S E _ D O U B L E S = 0
P R I V A T E C P _ U S E _ C G T Y P E S = 0
)
ax_config_pred ( ${ APP_NAME } AX_USE_ALSOFT )
2023-02-24 19:33:26 +08:00
ax_config_pred ( ${ APP_NAME } AX_ENABLE_MFMEDIA )
ax_config_pred ( ${ APP_NAME } AX_ENABLE_MSEDGE_WEBVIEW2 )
2023-10-11 01:05:22 +08:00
if ( AX_ISA_SIMD MATCHES "sse" )
target_compile_definitions ( ${ APP_NAME } PRIVATE AX_USE_SSE=1 )
endif ( )
2024-02-20 05:37:12 +08:00
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( ${ APP_NAME } PRIVATE AX_DLLIMPORT=1 )
2022-05-19 10:54:42 +08:00
endif ( )
target_include_directories ( ${ APP_NAME }
2024-03-19 21:33:02 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / l u a
2024-02-04 22:09:36 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / s c r i p t i n g
2022-05-19 10:54:42 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / s c r i p t i n g / l u a - b i n d i n g s / m a n u a l
P R I V A T E $ { A X _ R O O T _ D I R }
2024-03-19 21:33:02 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y
2022-05-19 10:54:42 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s
P R I V A T E $ { A X _ R O O T _ D I R } / c o r e
P R I V A T E $ { A X _ R O O T _ D I R } / c o r e / p l a t f o r m
P R I V A T E $ { A X _ R O O T _ D I R } / c o r e / b a s e
P R I V A T E $ { A X _ R O O T _ D I R } / c o r e / a u d i o
P R I V A T E $ { A X _ R O O T _ D I R } / c o r e / p l a t f o r m / w i n 3 2
2024-03-19 21:33:02 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / f m t / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / r o b i n - m a p / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / f r e e t y p e / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / g l f w / i n c l u d e / G L F W
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / b o x 2 d / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / c h i p m u n k / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / e n g i n e / 3 r d p a r t y / f r e e t y p e / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / w e b p / s r c / w e b p
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / p u g i x m l
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / x x h a s h
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / C o n v e r t U T F
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o p e n a l / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o g g / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / g l a d / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / g l f w / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / p n g
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / u n z i p / .
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / l l h t t p / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / l u a / p l a i n l u a
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / l u a / t o l u a / .
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / l u a / l u a - c j s o n / .
2024-03-24 05:20:59 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / z l i b / _ x / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / j p e g - t u r b o / _ x / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o p e n s s l / _ x / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / c u r l / _ x / i n c l u d e
2024-03-19 21:33:02 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / y a s i o
2022-05-19 10:54:42 +08:00
)
2024-02-03 10:08:22 +08:00
2022-08-19 19:52:10 +08:00
SET ( CONFIGURATION_SUBFOLDER "" )
2022-05-19 10:54:42 +08:00
target_link_directories ( ${ APP_NAME }
2024-03-24 05:20:59 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o p e n s s l / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S }
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / z l i b / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S }
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / j p e g - t u r b o / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S }
P R I V A T E $ { A X _ R O O T _ D I R } / 3 r d p a r t y / c u r l / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S }
2022-08-19 19:52:10 +08:00
P R I V A T E $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / l i b # cmake will auto add suffix '/$(Configuration)', refer to https://github.com/Kitware/CMake/blob/master/Source/cmVisualStudio10TargetGenerator.cxx#L4145
2022-05-19 10:54:42 +08:00
)
2023-03-11 22:10:18 +08:00
# Linking platform libs
2022-11-17 21:26:17 +08:00
if ( WINDOWS )
target_link_libraries ( ${ APP_NAME } winmm Version )
else ( )
2023-11-19 09:38:12 +08:00
target_link_libraries ( ${ APP_NAME } X11 fontconfig )
2022-11-17 21:26:17 +08:00
endif ( )
2022-05-19 10:54:42 +08:00
2024-03-19 21:33:02 +08:00
# Linking engine and 3rdparty libs
2022-11-17 21:26:17 +08:00
set ( LIBS
2022-10-01 16:24:52 +08:00
a x m o l
2022-08-11 15:41:10 +08:00
b o x 2 d
c h i p m u n k
f r e e t y p e
r e c a s t
b u l l e t
w e b p
p u g i x m l
x x h a s h
2023-07-02 01:08:04 +08:00
f a s t l z
2022-09-02 10:36:25 +08:00
c l i p p e r 2
2022-08-11 15:41:10 +08:00
C o n v e r t U T F
p o l y 2 t r i
2023-05-10 13:45:40 +08:00
a s t c e n c
2022-08-11 15:41:10 +08:00
o g g
g l a d
g l f w
p n g
u n z i p
l l h t t p
2023-10-10 22:10:35 +08:00
s i m d j s o n
2022-08-11 15:41:10 +08:00
p h y s i c s - n o d e s
2024-02-03 10:08:22 +08:00
y a s i o
2024-02-04 22:09:36 +08:00
w e b s o c k e t - p a r s e r
2022-05-19 10:54:42 +08:00
)
2023-12-31 22:32:32 +08:00
if ( AX_ENABLE_EXT_DRAGONBONES )
list ( APPEND LIBS "cocostudio" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / D r a g o n B o n e s / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
if ( AX_ENABLE_EXT_COCOSTUDIO )
list ( APPEND LIBS "DragonBones" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / c o c o s t u d i o / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
if ( AX_ENABLE_EXT_ASSETMANAGER )
list ( APPEND LIBS "assets-manager" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / a s s e t s - m a n a g e r / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
if ( AX_ENABLE_EXT_PARTICLE3D )
list ( APPEND LIBS "particle3d" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / P a r t i c l e 3 D / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
if ( AX_ENABLE_EXT_SPINE )
list ( APPEND LIBS "spine" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / s p i n e / r u n t i m e / i n c l u d e
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / s p i n e / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
2023-02-24 19:33:26 +08:00
if ( AX_ENABLE_EXT_IMGUI )
list ( APPEND LIBS "ImGui" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / I m G u i / s r c
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / I m G u i / s r c / I m G u i / i m g u i
)
2023-02-24 19:33:26 +08:00
endif ( )
2023-09-12 01:06:28 +08:00
if ( AX_ENABLE_EXT_INSPECTOR )
list ( APPEND LIBS "Inspector" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / I n s p e c t o r / s r c
)
2023-09-12 01:06:28 +08:00
endif ( )
2023-12-31 22:32:32 +08:00
if ( AX_ENABLE_EXT_SDFGEN )
list ( APPEND LIBS "SDFGen" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / S D F G e n / s r c
)
2023-12-31 22:32:32 +08:00
endif ( )
2023-09-12 01:06:28 +08:00
2024-01-05 05:35:05 +08:00
if ( AX_ENABLE_EXT_DRAWNODEEX )
list ( APPEND LIBS "DrawNodeEx" )
2024-02-03 10:08:22 +08:00
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / D r a w N o d e E x / s r c
)
2024-01-05 05:35:05 +08:00
endif ( )
2024-02-03 10:08:22 +08:00
if ( AX_ENABLE_EXT_GUI )
list ( APPEND LIBS "GUI" )
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / G U I / s r c
)
endif ( )
2024-02-04 22:09:36 +08:00
if ( AX_ENABLE_EXT_FAIRYGUI )
list ( APPEND LIBS "fairygui" )
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / f a i r y g u i / s r c
)
endif ( )
if ( AX_ENABLE_EXT_LIVE2D )
list ( APPEND LIBS "Live2D" )
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / L i v e 2 D / F r a m e w o r k / s r c
)
endif ( )
if ( AX_ENABLE_EXT_EFFEKSEER )
list ( APPEND LIBS "EffekseerForCocos2d-x" )
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / E f f e k s e e r
)
endif ( )
if ( AX_ENABLE_EXT_PHYSICS_NODE )
list ( APPEND LIBS "physics-nodes" )
target_include_directories ( ${ APP_NAME }
P R I V A T E $ { A X _ R O O T _ D I R } / e x t e n s i o n s / p h y s i c s - n o d e s / s r c
)
endif ( )
2022-11-17 21:26:17 +08:00
if ( WINDOWS )
target_link_libraries ( ${ APP_NAME }
$ { L I B S }
z l i b
j p e g - s t a t i c
l i b c r y p t o
l i b s s l
l i b c u r l _ i m p
)
2024-03-28 10:45:20 +08:00
if ( AX_ENABLE_AUDIO )
target_link_libraries ( ${ APP_NAME }
O p e n A L 3 2
)
endif ( )
2022-11-17 21:26:17 +08:00
else ( )
target_link_libraries ( ${ APP_NAME }
$ { L I B S }
z
j p e g
c u r l
2022-11-17 23:20:26 +08:00
s s l
c r y p t o
2022-11-17 21:26:17 +08:00
)
2024-03-28 10:45:20 +08:00
if ( AX_ENABLE_AUDIO )
target_link_libraries ( ${ APP_NAME }
o p e n a l
)
endif ( )
2022-11-17 21:26:17 +08:00
endif ( )
2022-05-19 10:54:42 +08:00
2024-02-20 05:37:28 +08:00
target_link_libraries ( ${ APP_NAME } debug fmtd optimized fmt )
2022-05-19 10:54:42 +08:00
# Copy dlls to app bin dir
2022-11-17 21:26:17 +08:00
if ( WINDOWS )
set ( ssl_dll_suffix "" )
if ( WIN64 )
set ( ssl_dll_suffix "-${ARCH_ALIAS}" )
endif ( )
2022-05-19 10:54:42 +08:00
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
2022-11-17 21:26:17 +08:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2024-03-24 05:20:59 +08:00
" $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o p e n s s l / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / l i b c r y p t o - 3 $ { s s l _ d l l _ s u f f i x } . d l l "
" $ { A X _ R O O T _ D I R } / 3 r d p a r t y / o p e n s s l / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / l i b s s l - 3 $ { s s l _ d l l _ s u f f i x } . d l l "
" $ { A X _ R O O T _ D I R } / 3 r d p a r t y / c u r l / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / l i b c u r l . d l l "
" $ { A X _ R O O T _ D I R } / 3 r d p a r t y / z l i b / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / z l i b 1 . d l l "
2022-11-17 21:26:17 +08:00
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } > )
2022-05-19 10:54:42 +08:00
2024-03-28 10:45:20 +08:00
if ( AX_ENABLE_AUDIO )
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } O p e n A L 3 2 . d l l "
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } > )
endif ( )
2023-01-06 18:38:16 +08:00
if ( BUILD_SHARED_LIBS )
2024-02-19 14:48:03 +08:00
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
2023-01-06 18:38:16 +08:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } g l a d . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } g l f w . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } p u g i x m l . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } f r e e t y p e . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } a x m o l . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } c o c o s t u d i o . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } G U I . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } p a r t i c l e 3 d . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } p h y s i c s - n o d e s . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } s p i n e . d l l "
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } a s s e t s - m a n a g e r . d l l "
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } > )
endif ( )
2022-11-17 21:26:17 +08:00
# Copy windows angle binaries
2023-09-02 19:56:50 +08:00
if ( AX_GLES_PROFILE )
2022-11-16 17:03:39 +08:00
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
2022-11-17 21:26:17 +08:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2024-03-24 05:20:59 +08:00
$ { A X _ R O O T _ D I R } / 3 r d p a r t y / a n g l e / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / l i b G L E S v 2 . d l l
$ { A X _ R O O T _ D I R } / 3 r d p a r t y / a n g l e / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / l i b E G L . d l l
$ { A X _ R O O T _ D I R } / 3 r d p a r t y / a n g l e / _ x / l i b / $ { P L A T F O R M _ N A M E } / $ { A R C H _ A L I A S } / d 3 d c o m p i l e r _ 4 7 . d l l
2022-05-19 10:54:42 +08:00
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } >
)
2022-11-17 21:26:17 +08:00
endif ( )
if ( AX_ENABLE_MSEDGE_WEBVIEW2 )
2023-04-02 16:04:19 +08:00
if ( CMAKE_GENERATOR MATCHES "Ninja" )
2022-11-17 21:26:17 +08:00
target_link_libraries ( ${ APP_NAME } ${ AX_ROOT_DIR } / ${ AX_PREBUILT_DIR } /packages/Microsoft.Web.WebView2/build/native/ ${ ARCH_ALIAS } /WebView2Loader.dll.lib )
target_include_directories ( ${ APP_NAME } PRIVATE ${ AX_ROOT_DIR } / ${ AX_PREBUILT_DIR } /packages/Microsoft.Web.WebView2/build/native/include )
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
2023-04-02 16:04:19 +08:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / p a c k a g e s / M i c r o s o f t . W e b . W e b V i e w 2 / b u i l d / n a t i v e / $ { A R C H _ A L I A S } / W e b V i e w 2 L o a d e r . d l l "
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } >
)
2022-11-17 21:26:17 +08:00
else ( )
target_link_libraries ( ${ APP_NAME } ${ AX_ROOT_DIR } / ${ AX_PREBUILT_DIR } /packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets )
endif ( )
2022-05-19 10:54:42 +08:00
endif ( )
endif ( )
2023-10-16 20:24:59 +08:00
# prebuilt, need copy axslc folder to target output directory
get_target_property ( rt_output ${ APP_NAME } RUNTIME_OUTPUT_DIRECTORY )
ax_sync_target_res ( ${ APP_NAME } LINK_TO "${rt_output}/${CMAKE_CFG_INTDIR}/axslc" FOLDERS ${ GLSLCC_OUT_DIR_ENGINE } SYNC_TARGET_ID axslc-builtin )
2022-08-11 15:41:10 +08:00
endfunction ( ax_link_cxx_prebuilt )
2022-05-19 10:54:42 +08:00
2022-08-11 15:41:10 +08:00
function ( ax_link_lua_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR )
2023-10-11 21:42:01 +08:00
if ( NOT BUILD_SHARED_LIBS )
2022-05-19 10:54:42 +08:00
target_compile_definitions ( ${ APP_NAME }
P R I V A T E _ U S R L U A S T A T I C = 1
)
endif ( )
2022-08-08 18:02:17 +08:00
target_link_libraries ( ${ APP_NAME } axlua lua-cjson tolua plainlua )
2022-11-17 23:20:26 +08:00
ax_link_cxx_prebuilt ( ${ APP_NAME } ${ AX_ROOT_DIR } ${ AX_PREBUILT_DIR } )
2022-11-17 21:26:17 +08:00
if ( WINDOWS )
2023-04-02 16:04:19 +08:00
if ( MSVC )
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ { B U I L D _ C O N F I G _ D I R } p l a i n l u a . d l l "
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } > )
else ( )
add_custom_command ( TARGET ${ APP_NAME } POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { A X _ R O O T _ D I R } / $ { A X _ P R E B U I L T _ D I R } / b i n / $ < C O N F I G > / p l a i n l u a . d l l "
$ < T A R G E T _ F I L E _ D I R : $ { A P P _ N A M E } > )
endif ( )
2022-11-17 21:26:17 +08:00
endif ( )
2022-08-11 15:41:10 +08:00
endfunction ( ax_link_lua_prebuilt )