2021-03-12 12:40:45 +01:00
|
|
|
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
project(tl-parser LANGUAGES C)
|
2021-03-12 12:31:51 +01:00
|
|
|
|
|
|
|
set(SOURCES crc32.h crc32.c tlc.c tl-parser.c tl-parser.h tl-parser-tree.h tl-tl.h portable_endian.h)
|
|
|
|
|
|
|
|
if (WIN32)
|
2021-03-12 12:40:45 +01:00
|
|
|
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
|
|
|
|
list(APPEND SOURCES wgetopt.c wgetopt.h)
|
|
|
|
if (MSVC)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /wd4101 /wd4244 /wd4267")
|
|
|
|
endif()
|
2021-03-12 12:31:51 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
2021-03-12 12:40:45 +01:00
|
|
|
|
2021-03-12 12:31:51 +01:00
|
|
|
if (NOT WIN32)
|
2021-03-12 12:40:45 +01:00
|
|
|
target_link_libraries(${PROJECT_NAME} m)
|
2021-03-12 12:31:51 +01:00
|
|
|
endif()
|