tdlight/td/generate/tl-parser/CMakeLists.txt

26 lines
678 B
CMake
Raw Normal View History

2021-03-04 01:40:56 +03:00
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2021-10-07 17:35:41 +03:00
if (POLICY CMP0065)
# do not export symbols from executables
# affects compiler checks in project(), so must be set before it
cmake_policy(SET CMP0065 NEW)
endif()
2021-03-04 01:40:56 +03:00
project(tl-parser LANGUAGES C)
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)
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
list(APPEND SOURCES wgetopt.c wgetopt.h)
if (MSVC)
2021-03-04 14:06:32 +03:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /wd4101 /wd4244 /wd4267")
2021-03-04 01:40:56 +03:00
endif()
endif()
add_executable(${PROJECT_NAME} ${SOURCES})
if (NOT WIN32)
2021-03-27 05:19:22 +03:00
target_link_libraries(${PROJECT_NAME} PRIVATE m)
2021-03-04 01:40:56 +03:00
endif()