mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 14:26:06 +02:00
Move import/export macros into CMake
This commit is contained in:
@ -4,7 +4,13 @@ option(USE_SDL2 "Use the SDL2 backend" FALSE)
|
||||
# Compiler flags
|
||||
|
||||
add_definitions(-DIRRLICHT_EXPORTS)
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(WIN32)
|
||||
add_definitions("-DIRRLICHT_API=__declspec(dllexport)")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
|
||||
add_definitions("-DIRRLICHT_API=__attribute__ ((visibility(\"default\")))")
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-D_IRR_STATIC_LIB_)
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@ -453,13 +459,12 @@ target_include_directories(IrrlichtMt
|
||||
|
||||
target_link_libraries(IrrlichtMt PRIVATE ${link_libs})
|
||||
|
||||
# Propagate static library flag to lib users, only needed for Windows
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(IrrlichtMt INTERFACE _IRR_STATIC_LIB_)
|
||||
endif()
|
||||
if(WIN32)
|
||||
target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_)
|
||||
endif()
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(IrrlichtMt INTERFACE IRRLICHT_API=__declspec(dllimport))
|
||||
endif()
|
||||
if(APPLE OR ANDROID OR EMSCRIPTEN)
|
||||
target_compile_definitions(IrrlichtMt PUBLIC IRR_MOBILE_PATHS)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user