[CMake] Use target_compile_definitions to avoid affecting global definitions (#121)
This commit is contained in:
parent
b945eddb2c
commit
fe3f6bda11
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 2.8.12)
|
||||||
|
|
||||||
include (utils.cmake)
|
include (utils.cmake)
|
||||||
|
|
||||||
@ -13,10 +13,6 @@ set(SO_MAJOR 2)
|
|||||||
set(SO_MINOR 1)
|
set(SO_MINOR 1)
|
||||||
set(SO_PATCH 1)
|
set(SO_PATCH 1)
|
||||||
|
|
||||||
add_definitions (
|
|
||||||
-DUTF8PROC_EXPORTS
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
|
||||||
endif ()
|
endif ()
|
||||||
@ -26,6 +22,8 @@ add_library (utf8proc
|
|||||||
utf8proc.h
|
utf8proc.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(utf8proc PRIVATE "UTF8PROC_EXPORTS")
|
||||||
|
|
||||||
set_target_properties (utf8proc PROPERTIES
|
set_target_properties (utf8proc PROPERTIES
|
||||||
POSITION_INDEPENDENT_CODE ON
|
POSITION_INDEPENDENT_CODE ON
|
||||||
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
|
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user