-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from dictu-lang/develop
Release 0.11.0
- Loading branch information
Showing
136 changed files
with
5,981 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
cmake_minimum_required(VERSION 3.16.5) | ||
project(Dictu C) | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
set(CMAKE_C_EXTENSIONS ON) | ||
|
||
set(DISABLE_HTTP OFF CACHE BOOL "Determines if HTTPS based features are compiled. HTTPS based features require cURL.") | ||
set(DISABLE_LINENOISE OFF CACHE BOOL "Determines if the REPL uses linenoise. Linenoise requires termios.") | ||
|
||
file(GLOB_RECURSE sources "c/*.c") | ||
file(GLOB_RECURSE headers "c/*.h") | ||
set(libraries) | ||
|
||
if(DISABLE_HTTP) | ||
list(FILTER sources EXCLUDE REGEX "http.c") | ||
list(FILTER headers EXCLUDE REGEX "http.h") | ||
add_compile_definitions(DISABLE_HTTP) | ||
else() | ||
list(APPEND libraries curl) | ||
endif() | ||
|
||
if(DISABLE_LINENOISE) | ||
add_compile_definitions(DISABLE_LINENOISE) | ||
endif() | ||
|
||
if(WIN32) | ||
# ws2_32 is required for winsock2.h to work correctly | ||
list(APPEND libraries ws2_32) | ||
else() | ||
list(APPEND libraries m) | ||
endif() | ||
|
||
if(MSVC) | ||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS) | ||
set(CMAKE_C_FLAGS "/WX /W1") | ||
set(CMAKE_C_FLAGS_DEBUG "/Zi") | ||
set(CMAKE_C_FLAGS_RELEASE "/O2") | ||
else() | ||
set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wshadow -Wunused-function -Wunused-macros") | ||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g") | ||
set(CMAKE_C_FLAGS_RELEASE "-O3 -flto") | ||
endif() | ||
|
||
if(CMAKE_BUILD_TYPE MATCHES Debug) | ||
add_compile_definitions(DEBUG DEBUG_STRESS_GC DEBUG_FINAL_MEM) | ||
endif() | ||
|
||
add_executable(${PROJECT_NAME} ${sources} ${headers}) | ||
|
||
target_link_libraries(${PROJECT_NAME} ${libraries}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.