this post was submitted on 04 Aug 2025
11 points (100.0% liked)

programming

260 readers
13 users here now

  1. Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.

  2. Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.

  3. Be kind, keep struggle sessions focused on the topic of programming.

founded 2 years ago
MODERATORS
 

CMake

spongebob-i-fucking-love bird-screm-2 monke-rage doggirl-growl what-in-the-goddamn

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  include(cmake/macOS/macOSBuild.cmake)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  include(cmake/win32/Win32Build.cmake)
elseif(UNIX AND NOT APPLE)
  include(cmake/linux/LinuxBuild.cmake)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if (POLICY CMP0141)
    cmake_policy(SET CMP0141 NEW)
    set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

target_include_directories(${OUTPUT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
    find_package(PkgConfig REQUIRED)

if(WIN32)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
    if(BUILD_AS_PORTABLE)
        add_definitions(-DPORTABLE_BUILD)
    endif()
endif()

Meson

doggirl-sleep commiku catgirl-happy

project(
  'myproject',
  'c',
  meson_version : '>= 1.3.0',
  version : '0.1',
  default_options : ['warning_level=3'],
)

dependencies = [
]

exe = executable(
  'myproject',
  'myproject.c',
  dependencies : dependencies,
  install : true,
)

test('basic', exe)

No this is not biased, you are dean-sussy

you are viewing a single comment's thread
view the rest of the comments
[–] Llituro@hexbear.net 4 points 1 day ago (2 children)

there was a time in my life that involved the hell of a cmake file I neither wrote nor could read and i would not wish that upon anyone.

[–] billgamesh@hexbear.net 4 points 1 day ago

Everytime it doesn't work perfectly the first time, compiling is going to be a nightmare. At least it's not autohell though

load more comments (1 replies)