CMake: Make all target_compile_definitions private
It is only used to build scintilla, no need to expose these definitions to external projects.
This commit is contained in:
@@ -500,18 +500,15 @@ macro(wx_lib_include_directories name)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# wx_lib_compile_definitions(name [])
|
# wx_lib_compile_definitions(name defs)
|
||||||
# Forwards everything to target_compile_definitions() except for monolithic
|
# Forwards everything to target_compile_definitions() except for monolithic
|
||||||
# build where it collects all definitions for linking with the mono lib
|
# build where it collects all definitions for linking with the mono lib
|
||||||
macro(wx_lib_compile_definitions name)
|
macro(wx_lib_compile_definitions name)
|
||||||
if(wxBUILD_MONOLITHIC)
|
if(wxBUILD_MONOLITHIC)
|
||||||
cmake_parse_arguments(_LIB_DEFINITIONS "" "" "PUBLIC;PRIVATE" ${ARGN})
|
list(APPEND wxMONO_DEFINITIONS ${ARGN})
|
||||||
list(APPEND wxMONO_DEFINITIONS_PUBLIC ${_LIB_DEFINITIONS_PUBLIC})
|
set(wxMONO_DEFINITIONS ${wxMONO_DEFINITIONS} PARENT_SCOPE)
|
||||||
list(APPEND wxMONO_DEFINITIONS_PRIVATE ${_LIB_DEFINITIONS_PRIVATE})
|
|
||||||
set(wxMONO_DEFINITIONS_PUBLIC ${wxMONO_DEFINITIONS_PUBLIC} PARENT_SCOPE)
|
|
||||||
set(wxMONO_DEFINITIONS_PRIVATE ${wxMONO_DEFINITIONS_PRIVATE} PARENT_SCOPE)
|
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(${name};${ARGN})
|
target_compile_definitions(${name} PRIVATE ${ARGN})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ if(wxBUILD_MONOLITHIC)
|
|||||||
set(wxMONO_LIBS_PRIVATE)
|
set(wxMONO_LIBS_PRIVATE)
|
||||||
set(wxMONO_LIBS_PUBLIC)
|
set(wxMONO_LIBS_PUBLIC)
|
||||||
set(wxMONO_INCLUDE_DIRS)
|
set(wxMONO_INCLUDE_DIRS)
|
||||||
|
set(wxMONO_DEFINITIONS)
|
||||||
set(wxMONO_NONCOMPILED_CPP_FILES)
|
set(wxMONO_NONCOMPILED_CPP_FILES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -84,13 +85,13 @@ if(wxBUILD_MONOLITHIC)
|
|||||||
|
|
||||||
target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}})
|
target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}})
|
||||||
endif()
|
endif()
|
||||||
if(wxMONO_DEFINITIONS_${vis})
|
|
||||||
target_compile_definitions(wxmono ${vis} ${wxMONO_DEFINITIONS_${vis}})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
if(wxMONO_INCLUDE_DIRS)
|
if(wxMONO_INCLUDE_DIRS)
|
||||||
target_include_directories(wxmono BEFORE PRIVATE ${wxMONO_INCLUDE_DIRS})
|
target_include_directories(wxmono BEFORE PRIVATE ${wxMONO_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
if(wxMONO_DEFINITIONS)
|
||||||
|
target_compile_definitions(wxmono PRIVATE ${wxMONO_DEFINITIONS})
|
||||||
|
endif()
|
||||||
foreach(file ${wxMONO_NONCOMPILED_CPP_FILES})
|
foreach(file ${wxMONO_NONCOMPILED_CPP_FILES})
|
||||||
set_source_files_properties(${file} PROPERTIES HEADER_FILE_ONLY TRUE)
|
set_source_files_properties(${file} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ target_include_directories(wxscintilla PRIVATE
|
|||||||
${wxSOURCE_DIR}/src/stc/scintilla/lexlib
|
${wxSOURCE_DIR}/src/stc/scintilla/lexlib
|
||||||
${wxSOURCE_DIR}/src/stc/scintilla/src
|
${wxSOURCE_DIR}/src/stc/scintilla/src
|
||||||
)
|
)
|
||||||
target_compile_definitions(wxscintilla PUBLIC
|
target_compile_definitions(wxscintilla PRIVATE
|
||||||
NO_CXX11_REGEX
|
NO_CXX11_REGEX
|
||||||
__WX__
|
__WX__
|
||||||
SCI_LEXER
|
SCI_LEXER
|
||||||
@@ -188,7 +188,7 @@ wx_lib_include_directories(wxstc
|
|||||||
${wxSOURCE_DIR}/src/stc/scintilla/lexlib
|
${wxSOURCE_DIR}/src/stc/scintilla/lexlib
|
||||||
${wxSOURCE_DIR}/src/stc/scintilla/src
|
${wxSOURCE_DIR}/src/stc/scintilla/src
|
||||||
)
|
)
|
||||||
wx_lib_compile_definitions(wxstc PRIVATE
|
wx_lib_compile_definitions(wxstc
|
||||||
NO_CXX11_REGEX
|
NO_CXX11_REGEX
|
||||||
__WX__
|
__WX__
|
||||||
SCI_LEXER
|
SCI_LEXER
|
||||||
|
|||||||
Reference in New Issue
Block a user