diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt index 238ba2f..424229d 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt @@ -4,8 +4,6 @@ project(altv-capi) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -53,6 +51,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-client/lib RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-client/bin ) + target_compile_options(altv-capi-client PRIVATE + $,/MTd,/MT> + ) add_custom_command(TARGET altv-capi-client POST_BUILD # POST BUILD COMMANDS COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/client/altv-capi.h ${PROJECT_BINARY_DIR}/altv-capi-client/include/client/altv-capi.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/altv-capi-client.h ${PROJECT_BINARY_DIR}/altv-capi-client/include/altv-capi-client.h @@ -76,6 +77,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-client-static/bin POSITION_INDEPENDENT_CODE ON ) + target_compile_options(altv-capi-client-static PRIVATE + $,/MTd,/MT> + ) add_custom_command(TARGET altv-capi-client-static POST_BUILD # POST BUILD COMMANDS COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/client/altv-capi.h ${PROJECT_BINARY_DIR}/altv-capi-client-static/include/client/altv-capi.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/altv-capi-client.h ${PROJECT_BINARY_DIR}/altv-capi-client-static/include/altv-capi-client.h @@ -102,6 +106,7 @@ else() WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) endif() + add_library(altv-capi-server SHARED ${CMAKE_SOURCE_DIR}/altv-capi-server.cpp ) @@ -117,6 +122,12 @@ set_target_properties(altv-capi-server PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-server/lib RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-server/bin ) +target_compile_options(altv-capi-server PRIVATE + $<$,$>:/MD> + $<$,$>:/MDd> + $<$,$>:/MD> + $<$,$>:/MD> +) add_custom_command(TARGET altv-capi-server POST_BUILD # POST BUILD COMMANDS COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/server/altv-capi.h ${PROJECT_BINARY_DIR}/altv-capi-server/include/server/altv-capi.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/altv-capi-server.h ${PROJECT_BINARY_DIR}/altv-capi-server/include/altv-capi-server.h @@ -140,6 +151,12 @@ set_target_properties(altv-capi-server-static PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/altv-capi-server-static/bin POSITION_INDEPENDENT_CODE ON ) +target_compile_options(altv-capi-server-static PRIVATE + $<$,$>:/MD> + $<$,$>:/MDd> + $<$,$>:/MD> + $<$,$>:/MD> +) add_custom_command(TARGET altv-capi-server POST_BUILD # POST BUILD COMMANDS COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/server/altv-capi.h ${PROJECT_BINARY_DIR}/altv-capi-server-static/include/server/altv-capi.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/altv-capi-server.h ${PROJECT_BINARY_DIR}/altv-capi-server-static/include/altv-capi-server.h