Edit readme and compiler flags from CMake

fixes-turtlebasket
Mattia Montanari 2022-07-19 15:19:07 +02:00
parent 101502c438
commit 5c2a763999
2 changed files with 14 additions and 8 deletions

View File

@ -42,13 +42,19 @@ set( CMAKE_POLICY_DEFAULT_CMP0079 NEW)
set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set( CMAKE_INCLUDE_CURRENT_DIR TRUE) set( CMAKE_INCLUDE_CURRENT_DIR TRUE)
# Set default compile flags for GCC # Set compile flags
if(CMAKE_COMPILER_IS_GNUC) message(STATUS "Compiler in use: ${CMAKE_C_COMPILER_ID}")
message(STATUS "GCC detected, adding compile flags") set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wunused-macros") set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror")
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wno-unused-command-line-argument")
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror -Wno-unused-command-line-argument") if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
endif(CMAKE_COMPILER_IS_GNUC) # To use Clang, pass to cmake: -DCMAKE_C_COMPILER="clang"
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# To use Clang, pass to cmake: -DCMAKE_C_COMPILER="gcc"
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wunused-macros -Wno-unused-command-line-argument")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
endif()
set( GK_PUBLIC_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) set( GK_PUBLIC_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

View File

@ -33,7 +33,7 @@ followed by these commands:
``` ```
cmake -E make_directory build cmake -E make_directory build
cmake -E chdir build cmake -DRUN_UNITESTS=ON -DCMAKE_BUILD_TYPE=Release .. cmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build build cmake --build build
cmake -E chdir build/examples/c ./example_lib_opengjk_ce cmake -E chdir build/examples/c ./example_lib_opengjk_ce
cmake -E chdir "build/test" ctest --build-config Release cmake -E chdir "build/test" ctest --build-config Release