File tree Expand file tree Collapse file tree
desktop/main/early_session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ add_subdirectory(device)
2121# Create the unified static library
2222add_library (cfbase STATIC )
2323
24+ # Define that we are building a static library (disables dllimport/dllexport)
25+ target_compile_definitions (cfbase PUBLIC CFBASE_STATIC_BUILD )
26+
2427# Link static libraries from sub-modules
2528target_link_libraries (cfbase PUBLIC
2629 cfbase_cpu
Original file line number Diff line number Diff line change 2929 */
3030
3131#if defined(_WIN32 ) || defined(_MSC_VER )
32- # ifdef CFBASE_EXPORTS
32+ # ifdef CFBASE_STATIC_BUILD
33+ # define CF_BASE_EXPORT
34+ # elif defined(CFBASE_EXPORTS )
3335# define CF_BASE_EXPORT __declspec(dllexport)
3436# else
3537# define CF_BASE_EXPORT __declspec(dllimport)
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ target_include_directories(CFDesktopEarlySession PUBLIC ${CMAKE_CURRENT_SOURCE_D
1515
1616# Link against cfbase to access device headers and other base utilities
1717# Link against cflogger to access cflog.h
18+ # Link against CFDesktopLog for log_helper functions
1819target_link_libraries (CFDesktopEarlySession PUBLIC
19- cfbase cflogger cfasciiart cffilesystem
20+ cfbase cflogger cfasciiart cffilesystem CFDesktopLog
2021 Qt6::Core
2122 Qt6::Gui
2223 Qt6::Widgets )
Original file line number Diff line number Diff line change @@ -36,7 +36,12 @@ function Clean-BuildDir {
3636 }
3737
3838 # 安全检查:路径不能是根目录
39- $normalizedPath = (Resolve-Path - LiteralPath $BuildPath - ErrorAction SilentlyContinue)? .Path ?? $BuildPath
39+ $resolvedPath = Resolve-Path - LiteralPath $BuildPath - ErrorAction SilentlyContinue
40+ if ($resolvedPath ) {
41+ $normalizedPath = $resolvedPath.Path
42+ } else {
43+ $normalizedPath = $BuildPath
44+ }
4045 if ($normalizedPath -eq " " -or $normalizedPath -eq " /" -or $normalizedPath -eq " \" ) {
4146 Write-LogError " ERROR: Refusing to clean root directory!"
4247 return $false
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ add_subdirectory(models)
2424
2525add_library (cfui STATIC )
2626
27+ # Define that we are building a static library (disables dllimport/dllexport)
28+ target_compile_definitions (cfui PUBLIC CFUI_STATIC_BUILD )
29+
2730# Link against STATIC libraries from sub-modules
2831# Order: dependencies first (left), then dependents (right)
2932# Static libraries are linked left-to-right, so dependents must come after their dependencies
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ add_library(cf_ui_base STATIC
1212 easing.cpp
1313)
1414
15- # Define CFUI_EXPORTS so symbols are marked as dllexport when compiling for the DLL
16- target_compile_definitions (cf_ui_base PRIVATE CFUI_EXPORTS )
15+ # Define CFUI_STATIC_BUILD so symbols are NOT marked as dllexport when compiling for static library
16+ target_compile_definitions (cf_ui_base PUBLIC CFUI_STATIC_BUILD )
1717
1818# Add include directories so headers can be found with ui/base/ prefix
1919# We need to add the ui parent directory so that ui/base/math_helper.h works
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ add_library(cf_ui_components STATIC
1313 timing_animation.cpp
1414)
1515
16+ # Define CFUI_STATIC_BUILD so symbols are NOT marked as dllexport when compiling for static library
17+ target_compile_definitions (cf_ui_components PUBLIC CFUI_STATIC_BUILD )
18+
1619# Add include directories
1720target_include_directories (cf_ui_components PUBLIC
1821 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } >
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ add_library(cf_ui_components_material STATIC
1212 cfmaterial_animation_strategy.cpp
1313)
1414
15- # Define CFUI_EXPORTS so symbols are marked as dllexport when compiling for the DLL
16- target_compile_definitions (cf_ui_components_material PRIVATE CFUI_EXPORTS )
15+ # Define CFUI_STATIC_BUILD so symbols are NOT marked as dllexport when compiling for static library
16+ target_compile_definitions (cf_ui_components_material PUBLIC CFUI_STATIC_BUILD )
1717
1818# Add include directories
1919target_include_directories (cf_ui_components_material PUBLIC
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ add_library(cf_ui_core STATIC
1515 theme_manager.cpp
1616)
1717
18- # Define CFUI_EXPORTS so symbols are marked as dllexport when compiling for the DLL
19- target_compile_definitions (cf_ui_core PRIVATE CFUI_EXPORTS )
18+ # Define CFUI_STATIC_BUILD so symbols are NOT marked as dllexport when compiling for static library
19+ target_compile_definitions (cf_ui_core PUBLIC CFUI_STATIC_BUILD )
2020
2121# Link against material sub-module and base
2222target_link_libraries (cf_ui_core PUBLIC
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ add_library(cf_ui_core_material STATIC
1212 material_factory.cpp
1313)
1414
15- # Define CFUI_EXPORTS so symbols are marked as dllexport when compiling for the DLL
16- target_compile_definitions (cf_ui_core_material PRIVATE CFUI_EXPORTS )
15+ # Define CFUI_STATIC_BUILD so symbols are NOT marked as dllexport when compiling for static library
16+ target_compile_definitions (cf_ui_core_material PUBLIC CFUI_STATIC_BUILD )
1717
1818# Add include directories
1919target_include_directories (cf_ui_core_material PUBLIC
You can’t perform that action at this time.
0 commit comments