forked from Green-Sky/tomato
support building tomato as a lib/shared object
This commit is contained in:
parent
ba7188cf66
commit
ef79aa8b80
@ -18,6 +18,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
|||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||||
|
|
||||||
|
option(TOMATO_MAIN_SO "Build tomato as a shared object (for eg android apps)" ANDROID)
|
||||||
option(TOMATO_ASAN "Build tomato with asan (gcc/clang/msvc)" OFF)
|
option(TOMATO_ASAN "Build tomato with asan (gcc/clang/msvc)" OFF)
|
||||||
|
|
||||||
if (TOMATO_ASAN)
|
if (TOMATO_ASAN)
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.9...3.24 FATAL_ERROR)
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
add_executable(tomato
|
if (TOMATO_MAIN_SO)
|
||||||
|
add_library(tomato MODULE)
|
||||||
|
target_compile_definitions(tomato PUBLIC TOMATO_MAIN_SO)
|
||||||
|
else()
|
||||||
|
add_executable(tomato)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_sources(tomato PUBLIC
|
||||||
./main.cpp
|
./main.cpp
|
||||||
./icon.rc
|
./icon.rc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user