From 771ece92d3bad54555665a4ea663fc91224a6de9 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 13 Feb 2024 11:33:09 -0500 Subject: Set compiler flags specific compilers --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d74920..42b78ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,22 @@ cmake_minimum_required(VERSION 3.15) project(OMC C) include(GNUInstallDirs) +set(nix_cflags -Wall -Wextra) +set(win_cflags /Wall) set(CMAKE_C_STANDARD 99) + link_libraries(curl) + +if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + message("gnu options") + add_compile_options(${nix_cflags}) +elseif (CMAKE_C_COMPILER_ID MATCHES "Clang") + add_compile_options(${nix_cflags}) +elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC") + message("microsoft visual c options") + add_compile_options(${win_cflags}) +endif() + add_subdirectory(src) set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}") -- cgit