summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-09 23:12:09 -0500
committerpommicket <pommicket@gmail.com>2023-01-09 23:12:09 -0500
commitedd5188dfba93b8ffe376d0c194804f35f43dcaa (patch)
tree9e1ef13632c9e0fbfd175bc82c79f874b2b15229 /CMakeLists.txt
parent7f0255cb40bb85276191ec3ddffe507e53abf2ac (diff)
misc windows fixes
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 13 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1a59e7..87d5fbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,24 @@
cmake_minimum_required(VERSION 3.1)
project(ted)
-set(SOURCES buffer.c build.c colors.c command.c config.c find.c gl.c ide-autocomplete.c
- ide-definitions.c ide-highlights.c ide-hover.c ide-signature-help.c ide-usages.c
- lsp.c lsp-json.c lsp-parse.c lsp-write.c main.c menu.c node.c os.c session.c
- stb_image.c stb_truetype.c syntax.c tags.c ted.c text.c ui.c util.c)
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(SOURCES buffer.c build.c colors.c command.c config.c find.c gl.c ide-autocomplete.c
+ ide-definitions.c ide-highlights.c ide-hover.c ide-signature-help.c ide-usages.c
+ lsp.c lsp-json.c lsp-parse.c lsp-write.c main.c menu.c node.c os.c session.c
+ stb_image.c stb_truetype.c syntax.c tags.c ted.c text.c ui.c util.c)
+else()
+ set(SOURCES main.c)
+endif()
+
if (MSVC)
add_executable(ted WIN32 ${SOURCES})
else()
add_executable(ted ${SOURCES})
endif()
-target_compile_definitions(ted PUBLIC DEBUG=1)
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ target_compile_definitions(ted PUBLIC DEBUG=1)
+endif()
if(MSVC)
- target_sources(ted PRIVATE ted.res)
+ target_sources(ted PRIVATE ted.rc)
target_include_directories(ted PUBLIC ${CMAKE_SOURCE_DIR}/SDL2/include ${CMAKE_SOURCE_DIR}/pcre2)
set(CMAKE_C_FLAGS "/MD /W4 /wd4200 /wd4204 /wd4221 /wd4706 /wd4214 /D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1")