Update CMakeLists.txt

This commit is contained in:
Andrea Cavalli 2020-12-24 12:51:44 +01:00
parent 6ff5d408d8
commit c478b339e0
1 changed files with 6 additions and 1 deletions

View File

@ -1,11 +1,16 @@
cmake_minimum_required(VERSION 3.0)
project(tl-parser)
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)
list(APPEND SOURCES wingetopt.c wingetopt.h)
endif()
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "/SUBSYSTEM:CONSOLE")
endif()
add_executable(${PROJECT_NAME} crc32.h crc32.c tlc.c tl-parser.c tl-parser.h tl-parser-tree.h tl-tl.h portable_endian.h wingetopt.c wingetopt.h)
add_executable(${PROJECT_NAME} ${SOURCES})
if (NOT WIN32)
target_link_libraries(${PROJECT_NAME} m)
endif()