Because during development it's super annoying
script:
- mkdir build/
- cd build/
- - cmake ..
+ - cmake -DNOTHING_CI=ON ..
- make -k
cmake_minimum_required(VERSION 3.13)
project(nothing)
+set(NOTHING_CI OFF CACHE BOOL "Indicates whether the build is running on CI or not")
+
if(WIN32)
if(MINGW)
add_compile_definitions(SDL_MAIN_HANDLED) # https://stackoverflow.com/a/25089610
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} \
-Wall \
- -Werror \
-Wextra \
-Wconversion \
-Wunused \
-std=c11 \
-ggdb \
-O3")
+ if (${NOTHING_CI})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+ endif()
target_link_libraries(nothing m)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} \
/Wall \
- /WX \
/wd4127 \
/wd4201 \
/wd4204 \
/wd5045 \
/wd4200 \
/D \"_CRT_SECURE_NO_WARNINGS\"")
+ if (${NOTHING_CI})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
+ endif()
endif()
if(MINGW)
target_link_libraries(nothing hid setupapi Imm32 Version winmm)
- cd build
- ps: |
if ($isWindows -and $env:BUILD_TYPE -eq 'mingw') {
- C:\msys64\usr\bin\bash.exe -lc "cmake .. -G 'MSYS Makefiles'"
+ C:\msys64\usr\bin\bash.exe -lc "cmake .. -G 'MSYS Makefiles' -DNOTHING_CI=ON"
C:\msys64\usr\bin\bash.exe -lc "cmake --build ."
} else {
- cmake ..
+ cmake .. -DNOTHING_CI=ON
cmake --build .
}