Fix CMake configuration for GTK benchmark

This commit is contained in:
Alexey Andreev 2018-11-20 15:22:19 +03:00
parent c7e7e3b3f0
commit b4460b2282
2 changed files with 9 additions and 3 deletions

4
samples/benchmark/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/CMakeFiles
/CMakeCache.txt
/Makefile
/cmake_install.cmake

View File

@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.9)
project(teavm_c_example C)
project(teavm_benchmark C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/target/)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@ -13,9 +14,10 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
file(COPY support.c DESTINATION target/generated/c)
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER})
add_executable(teavm_c_example classes.c)
add_executable(teavm_benchmark target/generated/c/classes.c)
target_link_libraries(teavm_c_example ${GTK3_LIBRARIES} m)
target_link_libraries(teavm_benchmark ${GTK3_LIBRARIES} m)