Massive CMake refactoring... No code changes. (0.37.55)
This commit is contained in:
parent
a63aff3daa
commit
501be417e8
22 changed files with 513 additions and 568 deletions
24
cmake/Platform/Linux.cmake
Normal file
24
cmake/Platform/Linux.cmake
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Linux-specific configuration for Fun
|
||||
|
||||
# Default library directory (only set if not provided by user)
|
||||
if(NOT DEFINED DEFAULT_LIB_DIR OR DEFAULT_LIB_DIR STREQUAL "")
|
||||
set(DEFAULT_LIB_DIR "/usr/share/fun/lib" CACHE PATH "Default library directory for Fun stdlib (override with -DDEFAULT_LIB_DIR=...)" FORCE)
|
||||
endif()
|
||||
|
||||
# Handle musl toolchain selection when requested
|
||||
if(FUN_USE_MUSL)
|
||||
find_program(_FUN_MUSL_CC NAMES musl-gcc musl-clang)
|
||||
if(_FUN_MUSL_CC)
|
||||
message(STATUS "FUN_USE_MUSL=ON: using musl toolchain: ${_FUN_MUSL_CC}")
|
||||
set(CMAKE_C_COMPILER "${_FUN_MUSL_CC}" CACHE FILEPATH "C compiler" FORCE)
|
||||
set(FUN_LIBC "musl" CACHE STRING "Selected C library")
|
||||
add_compile_definitions(FUN_LIBC_MUSL)
|
||||
else()
|
||||
message(WARNING "FUN_USE_MUSL=ON but no musl toolchain (musl-gcc or musl-clang) found. Falling back to default compiler (likely glibc).")
|
||||
set(FUN_LIBC "glibc" CACHE STRING "Selected C library")
|
||||
add_compile_definitions(FUN_LIBC_GLIBC)
|
||||
endif()
|
||||
else()
|
||||
set(FUN_LIBC "glibc" CACHE STRING "Selected C library")
|
||||
add_compile_definitions(FUN_LIBC_GLIBC)
|
||||
endif()
|
||||
10
cmake/Platform/Windows.cmake
Normal file
10
cmake/Platform/Windows.cmake
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Windows-specific configuration for Fun
|
||||
|
||||
# Default library directory (only set if not provided by user)
|
||||
if(NOT DEFINED DEFAULT_LIB_DIR OR DEFAULT_LIB_DIR STREQUAL "")
|
||||
set(DEFAULT_LIB_DIR "C:/Users/Public/fun/lib" CACHE PATH "Default library directory for Fun stdlib (override with -DDEFAULT_LIB_DIR=...)" FORCE)
|
||||
endif()
|
||||
|
||||
# libc macro (non-musl path)
|
||||
set(FUN_LIBC "glibc" CACHE STRING "Selected C library")
|
||||
add_compile_definitions(FUN_LIBC_GLIBC)
|
||||
10
cmake/Platform/macOS.cmake
Normal file
10
cmake/Platform/macOS.cmake
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# macOS-specific configuration for Fun
|
||||
|
||||
# Default library directory (only set if not provided by user)
|
||||
if(NOT DEFINED DEFAULT_LIB_DIR OR DEFAULT_LIB_DIR STREQUAL "")
|
||||
set(DEFAULT_LIB_DIR "/Library/Application Support/fun/lib" CACHE PATH "Default library directory for Fun stdlib (override with -DDEFAULT_LIB_DIR=...)" FORCE)
|
||||
endif()
|
||||
|
||||
# libc macro (non-musl path)
|
||||
set(FUN_LIBC "glibc" CACHE STRING "Selected C library")
|
||||
add_compile_definitions(FUN_LIBC_GLIBC)
|
||||
Loading…
Add table
Add a link
Reference in a new issue