mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added build target with static linking
This commit is contained in:
@@ -58,5 +58,26 @@ endif()
|
|||||||
# visual studio debugger
|
# visual studio debugger
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT magicseteditor)
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT magicseteditor)
|
||||||
|
|
||||||
|
# Static linking on windows
|
||||||
|
if (${VCPKG_TARGET_TRIPLET} MATCHES ".*-static")
|
||||||
|
message("Static linking")
|
||||||
|
set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE)
|
||||||
|
foreach(CompilerFlag ${CompilerFlags})
|
||||||
|
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
|
||||||
|
endforeach()
|
||||||
|
# Need explicit dependencies on wx's dependencies
|
||||||
|
find_package(png REQUIRED)
|
||||||
|
find_package(tiff REQUIRED)
|
||||||
|
find_package(jpeg REQUIRED)
|
||||||
|
find_package(zlib REQUIRED)
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${PNG_LIBRARIES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${JPEG_LIBRARIES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${TIFF_LIBRARIES})
|
||||||
|
# Defines
|
||||||
|
add_definitions(-DSTATIC)
|
||||||
|
add_definitions(-DHUNSPELL_STATIC)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Test suite
|
# Test suite
|
||||||
include(test/tests.cmake)
|
include(test/tests.cmake)
|
||||||
|
|||||||
@@ -23,6 +23,42 @@
|
|||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "",
|
||||||
"inheritEnvironments": [ "msvc_x86" ],
|
"inheritEnvironments": [ "msvc_x86" ],
|
||||||
"variables": []
|
"variables": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
|
"variables": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-Release",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||||
|
"variables": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x86-Release-static",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||||
|
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"inheritEnvironments": [ "msvc_x86" ],
|
||||||
|
"variables": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user