From f6f40266ba57ab2df99b897c375f85f0a8a97856 Mon Sep 17 00:00:00 2001 From: Levent Kaya Date: Wed, 5 Nov 2025 22:11:58 +0300 Subject: [feature] basic structure --- cmake/PlatformConfig.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmake/PlatformConfig.cmake (limited to 'cmake/PlatformConfig.cmake') 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() -- cgit v1.2.3