summaryrefslogtreecommitdiff
path: root/cmake/PlatformConfig.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/PlatformConfig.cmake')
-rw-r--r--cmake/PlatformConfig.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/PlatformConfig.cmake b/cmake/PlatformConfig.cmake
new file mode 100644
index 0000000..f2f5252
--- /dev/null
+++ b/cmake/PlatformConfig.cmake
@@ -0,0 +1,26 @@
+# cmake/PlatformConfig.cmake
+#
+# Set platform-specific compile definitions and helper variables
+
+function(configure_platform target)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_compile_definitions(${target} PRIVATE BOLTDBG_PLATFORM_LINUX=1)
+ message(STATUS "Configuring for Linux")
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ target_compile_definitions(${target} PRIVATE BOLTDBG_PLATFORM_MACOS=1)
+ message(STATUS "Configuring for macOS")
+ elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
+ target_compile_definitions(${target} PRIVATE BOLTDBG_PLATFORM_WINDOWS=1)
+ message(STATUS "Configuring for Windows")
+ else()
+ target_compile_definitions(${target} PRIVATE BOLTDBG_PLATFORM_UNKNOWN=1)
+ message(WARNING "Unknown platform: ${CMAKE_SYSTEM_NAME}")
+ endif()
+
+ # Example: helper macro for visibility
+ if (MSVC)
+ target_compile_definitions(${target} PRIVATE BOLTDBG_EXPORT=__declspec(dllexport))
+ else()
+ target_compile_definitions(${target} PRIVATE BOLTDBG_EXPORT=__attribute__((visibility(\"default\"))))
+ endif()
+endfunction()