1
0
mirror of https://github.com/ScrelliCopter/VGM-Tools synced 2025-02-21 04:09:25 +11:00

combine all (except spctools) as subprojects

This commit is contained in:
2023-03-21 14:25:14 +11:00
parent 05008f5c47
commit 9946144995
8 changed files with 50 additions and 53 deletions

View File

@@ -1,21 +1,18 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(DspTool LANGUAGES C)
option(DSPTOOL_BUILD_SHARED_LIBS "Build as a Shared Object or DLL" OFF)
option(BUILD_SHARED_LIBS "Build as a Shared Object or DLL" OFF)
set(HEADERS dsptool.h ${COMMON}/util.h)
set(HEADERS dsptool.h)
set(SOURCES math.c decode.c encode.c)
add_library(DspTool ${HEADERS} ${SOURCES})
if (DSPTOOL_BUILD_SHARED_LIBS)
add_library(DspTool SHARED ${HEADERS} ${SOURCES})
target_compile_definitions(DspTool PRIVATE BUILD_SHARED)
else()
add_library(DspTool STATIC ${HEADERS} ${SOURCES})
target_compile_definitions(DspTool PRIVATE BUILD_STATIC)
endif()
add_library(DspTool::DspTool ALIAS DspTool)
set_property(TARGET DspTool PROPERTY C_STANDARD 99)
target_include_directories(DspTool
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${COMMON})
if (BUILD_SHARED_LIBS)
target_compile_definitions(DspTool PRIVATE BUILD_SHARED)
endif()
target_compile_options(DspTool PRIVATE
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wall -Wextra -pedantic -Wno-unused-parameter>
$<$<C_COMPILER_ID:MSVC>:/Wall /wd4100>)
target_include_directories(DspTool PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(DspTool PRIVATE ${WARNINGS})
target_link_libraries(DspTool PRIVATE Common::headers)

View File

@@ -14,7 +14,7 @@ extern "C" {
#if defined( _WIN32 ) || defined( __CYGWIN__ )
# ifdef BUILD_SHARED
# define DLLEXPORT __declspec(dllexport)
# elif defined( WHY_ARE_YOU_USING_THIS_AS_A_DLL )
# elif !defined( BUILD_STATIC )
# define DLLEXPORT __declspec(dllimport)
# else
# define DLLEXPORT