Create skeleton C project
This commit is contained in:
commit
5db711bd62
3 changed files with 27 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/build*/
|
||||
compile_commands.json
|
22
CMakeLists.txt
Normal file
22
CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
cmake_minimum_required(VERSION 3.7)
|
||||
project(SimpleArchiver C)
|
||||
|
||||
set(SimpleArchiver_VERSION 1.0)
|
||||
|
||||
set(SimpleArchiver_SOURCES
|
||||
src/main.c
|
||||
)
|
||||
|
||||
add_compile_options(
|
||||
-Wall -Wextra -Wpedantic -Wno-missing-braces
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-Weffc++>
|
||||
$<$<CONFIG:DEBUG>:-O0>
|
||||
)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to 'Debug', none was specified.")
|
||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||
endif()
|
||||
|
||||
add_executable(SimpleArchiver ${SimpleArchiver_SOURCES})
|
3
src/main.c
Normal file
3
src/main.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue