diff options
author | pommicket <pommicket@gmail.com> | 2023-01-10 10:40:10 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-10 10:40:10 -0500 |
commit | b0fe15647d196081d801db574fa074ff77e46f5f (patch) | |
tree | 786d4b15493ab469811fc7cd139f5d664f414644 /CMakeLists.txt | |
parent | edd5188dfba93b8ffe376d0c194804f35f43dcaa (diff) |
linux build , etc.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 87d5fbb..078ed3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,11 +9,20 @@ else() set(SOURCES main.c) endif() +# make the file names absolute so we can go-to-error. +set(SOURCES_ABSOLUTE ) +foreach(SOURCE ${SOURCES}) + get_filename_component(S ${CMAKE_SOURCE_DIR}/${SOURCE} ABSOLUTE) + set(SOURCES_ABSOLUTE ${SOURCES_ABSOLUTE};${S}) +endforeach() + if (MSVC) - add_executable(ted WIN32 ${SOURCES}) + add_executable(ted WIN32 ${SOURCES_ABSOLUTE}) else() - add_executable(ted ${SOURCES}) + add_executable(ted ${SOURCES_ABSOLUTE}) endif() + + if(CMAKE_BUILD_TYPE STREQUAL "Debug") target_compile_definitions(ted PUBLIC DEBUG=1) endif() @@ -21,11 +30,12 @@ if(MSVC) 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") + set(CMAKE_C_FLAGS_DEBUG "/WX /Zi /Ob0 /Od /RTC1") set(SDL2_LIB_DIR ${CMAKE_SOURCE_DIR}/SDL2/lib/x64) target_link_libraries(ted ${SDL2_LIB_DIR}/SDL2.lib) target_link_libraries(ted ${CMAKE_SOURCE_DIR}/pcre2-32-static.lib) else() + set(CMAKE_C_FLAGS "-Wall -Wextra -Wshadow -Wconversion -Wpedantic -pedantic -std=gnu11 -Wno-unused-function -Wno-fixed-enum-extension -Wimplicit-fallthrough -Wno-format-truncation -Wno-unknown-warning-option") target_link_libraries(ted m SDL2) target_link_libraries(ted ${CMAKE_SOURCE_DIR}/libpcre2-32.a) endif() |