2024-09-24 02:51:44 +08:00
|
|
|
cmake_minimum_required(VERSION 3.25)
|
|
|
|
|
project(HMCLauncher)
|
|
|
|
|
if(MSVC)
|
2024-11-05 00:20:42 +08:00
|
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
|
|
|
|
add_compile_options(/utf-8 /W4)
|
2024-09-24 02:51:44 +08:00
|
|
|
add_link_options(/ENTRY:wWinMainCRTStartup)
|
|
|
|
|
else()
|
|
|
|
|
add_compile_options(-municode -Wall -Wextra -Wpedantic)
|
|
|
|
|
add_link_options(-municode)
|
|
|
|
|
endif()
|
|
|
|
|
OPTION(ENABLE_MINGW_STATIC_LINK_LIBSTDCXX "Link the C++ standard library statically to the executable file(mingw only)." ON)
|
|
|
|
|
if(ENABLE_MINGW_STATIC_LINK_LIBSTDCXX AND MINGW)
|
|
|
|
|
add_link_options(-static)
|
|
|
|
|
endif()
|
|
|
|
|
set(CMAKE_WIN32_EXECUTABLE ON)
|
|
|
|
|
add_executable(HMCLauncher WIN32 HMCL/HMCL.rc HMCL/java.cpp HMCL/main.cpp HMCL/os.cpp HMCL/stdafx.cpp HMCL/Version.cpp)
|
|
|
|
|
target_link_libraries(HMCLauncher Version)
|
|
|
|
|
install(TARGETS HMCLauncher)
|