Skip to content

Commit d57c004

Browse files
committed
Added CMake/CLion project and associated files
1 parent a97d94f commit d57c004

File tree

7 files changed

+195
-2
lines changed

7 files changed

+195
-2
lines changed

.gitignore

+122-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ picoc
99
build/*
1010
archives/
1111

12-
CMakeLists.txt
1312
picoc.plist
1413
picoc.config
1514
picoc.creator
@@ -21,4 +20,125 @@ tests/fred.txt
2120
analysis.txt
2221
gmon.out
2322
tests/gmon.out
24-
.idea/
23+
24+
# Created by https://www.gitignore.io/api/macos,clion
25+
# Edit at https://www.gitignore.io/?templates=macos,clion
26+
27+
28+
### CLion ###
29+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
30+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
31+
32+
# User-specific stuff
33+
.idea/**/workspace.xml
34+
.idea/**/tasks.xml
35+
.idea/**/usage.statistics.xml
36+
.idea/**/dictionaries
37+
.idea/**/shelf
38+
39+
# Generated files
40+
.idea/**/contentModel.xml
41+
42+
# Sensitive or high-churn files
43+
.idea/**/dataSources/
44+
.idea/**/dataSources.ids
45+
.idea/**/dataSources.local.xml
46+
.idea/**/sqlDataSources.xml
47+
.idea/**/dynamic.xml
48+
.idea/**/uiDesigner.xml
49+
.idea/**/dbnavigator.xml
50+
51+
# Gradle
52+
.idea/**/gradle.xml
53+
.idea/**/libraries
54+
55+
# Gradle and Maven with auto-import
56+
# When using Gradle or Maven with auto-import, you should exclude module files,
57+
# since they will be recreated, and may cause churn. Uncomment if using
58+
# auto-import.
59+
# .idea/modules.xml
60+
# .idea/*.iml
61+
# .idea/modules
62+
# *.iml
63+
# *.ipr
64+
65+
# CMake
66+
cmake-build-*/
67+
68+
# Mongo Explorer plugin
69+
.idea/**/mongoSettings.xml
70+
71+
# File-based project format
72+
*.iws
73+
74+
# IntelliJ
75+
out/
76+
77+
# mpeltonen/sbt-idea plugin
78+
.idea_modules/
79+
80+
# JIRA plugin
81+
atlassian-ide-plugin.xml
82+
83+
# Cursive Clojure plugin
84+
.idea/replstate.xml
85+
86+
# Crashlytics plugin (for Android Studio and IntelliJ)
87+
com_crashlytics_export_strings.xml
88+
crashlytics.properties
89+
crashlytics-build.properties
90+
fabric.properties
91+
92+
# Editor-based Rest Client
93+
.idea/httpRequests
94+
95+
# Android studio 3.1+ serialized cache file
96+
.idea/caches/build_file_checksums.ser
97+
98+
### CLion Patch ###
99+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
100+
101+
# *.iml
102+
# modules.xml
103+
# .idea/misc.xml
104+
# *.ipr
105+
106+
# Sonarlint plugin
107+
.idea/**/sonarlint/
108+
109+
# SonarQube Plugin
110+
.idea/**/sonarIssues.xml
111+
112+
# Markdown Navigator plugin
113+
.idea/**/markdown-navigator.xml
114+
.idea/**/markdown-navigator/
115+
116+
### macOS ###
117+
# General
118+
.DS_Store
119+
.AppleDouble
120+
.LSOverride
121+
122+
# Icon must end with two \r
123+
Icon
124+
125+
# Thumbnails
126+
._*
127+
128+
# Files that might appear in the root of a volume
129+
.DocumentRevisions-V100
130+
.fseventsd
131+
.Spotlight-V100
132+
.TemporaryItems
133+
.Trashes
134+
.VolumeIcon.icns
135+
.com.apple.timemachine.donotpresent
136+
137+
# Directories potentially created on remote AFP share
138+
.AppleDB
139+
.AppleDesktop
140+
Network Trash Folder
141+
Temporary Items
142+
.apdisk
143+
144+
# End of https://www.gitignore.io/api/macos,clion

.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/picoc.iml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
project(picoc C)
3+
4+
execute_process(COMMAND git show-ref --abbrev=8 --head --hash head OUTPUT_VARIABLE hash OUTPUT_STRIP_TRAILING_WHITESPACE)
5+
execute_process(COMMAND git describe --abbrev=0 --tags OUTPUT_VARIABLE tag OUTPUT_STRIP_TRAILING_WHITESPACE)
6+
message("${tag} ${hash}")
7+
8+
set(CMAKE_C_STANDARD 11)
9+
set(CMAKE_C_COMPILER gcc)
10+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")
11+
set(CMAKE_REQUIRED_LIBRARIES m readline)
12+
add_definitions(-DUNIX_HOST -DVER="${hash}" -DTAG="${tag}")
13+
#add_definitions(-DDEBUG_EXPRESSIONS)
14+
15+
include_directories(.)
16+
17+
add_executable(picoc
18+
cstdlib/ctype.c
19+
cstdlib/errno.c
20+
cstdlib/math.c
21+
cstdlib/stdbool.c
22+
cstdlib/stdio.c
23+
cstdlib/stdlib.c
24+
cstdlib/string.c
25+
cstdlib/time.c
26+
cstdlib/unistd.c
27+
platform/library_unix.c
28+
platform/platform_unix.c
29+
clibrary.c
30+
debug.c
31+
expression.c
32+
heap.c
33+
include.c
34+
interpreter.h
35+
lex.c
36+
parse.c
37+
picoc.c
38+
picoc.h
39+
platform.c
40+
platform.h
41+
table.c
42+
type.c
43+
variable.c)
44+
45+
target_link_libraries(picoc -lm -lreadline)

0 commit comments

Comments
 (0)