Skip to content

Commit

Permalink
Add static link to DLLs for win32 MinGW executable
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkwan committed Dec 9, 2023
1 parent 185f894 commit 0c7ea44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (LINUX)
if (UNIX)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/windows.cmake CACHE STRING "Windows toolchain file")
endif()

Expand All @@ -17,10 +17,15 @@ message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'")

add_subdirectory(external/rapidxml)
include_directories(src)
if (LINUX)
if (UNIX)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()

add_compile_options(-static-libgcc)
add_compile_options(-static-libstdc++)
add_link_options(-static-libgcc)
add_link_options(-static-libstdc++)
file(GLOB_RECURSE cpp_files CONFIGURE_DEPENDS "src/*.*pp")
add_executable(${PROJECT_NAME} ${cpp_files})

Expand Down

0 comments on commit 0c7ea44

Please sign in to comment.