]> git.seodisparate.com - SimpleArchiver/commitdiff
Create skeleton C project
authorStephen Seo <seo.disparate@gmail.com>
Wed, 26 Jun 2024 08:57:23 +0000 (17:57 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 26 Jun 2024 08:57:23 +0000 (17:57 +0900)
.gitignore [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
src/main.c [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..36cfdb9
--- /dev/null
@@ -0,0 +1,2 @@
+/build*/
+compile_commands.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ea54f8
--- /dev/null
@@ -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})
diff --git a/src/main.c b/src/main.c
new file mode 100644 (file)
index 0000000..11b7fad
--- /dev/null
@@ -0,0 +1,3 @@
+int main(int argc, char **argv) {
+    return 0;
+}