Skip to content

Commit

Permalink
A few more comments to CMake config
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardob90 committed Jan 9, 2024
1 parent aaf4c29 commit c8c0e62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cleedpy/cleed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(cleed VERSION 1.0 LANGUAGES C)

# Specify the required C standard
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED True)

# Workaround for Apple Clang
# Disables the warning "implicit declaration of function '...' is invalid in C99"
if(APPLE AND "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
add_compile_options(-Wno-implicit-function-declaration)
endif()

# Set compiler and flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -march=native")

# Only set the compiler if strictly required; by default, let CMake find the most suitable one
#set(CMAKE_C_COMPILER "gcc-13")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -march=native")

# Global include directories or compiler options here
# Global include directories
include_directories(include)

# Add the src directory
Expand All @@ -24,5 +26,5 @@ add_subdirectory(src)
# Build the test
add_executable(test_cleed test_cleed.c)

# Link
# Link the test
target_link_libraries(test_cleed cleed)

0 comments on commit c8c0e62

Please sign in to comment.