Skip to content

Commit

Permalink
Merge pull request #1323 from cozycactus/cozycactus
Browse files Browse the repository at this point in the history
Cmake : Fix build in MSYS2 MINGW64 environment
  • Loading branch information
argilo authored Nov 16, 2023
2 parents d9b0372 + 51ee783 commit 6c03a9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-Wdouble-promotion)
add_definitions(-Wno-unused-parameter)
add_definitions(-Wsign-compare)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wdouble-promotion)
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wsign-compare)
endif()

if(MSVC)
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ endif()

#build a win32 app, not a console app
if (WIN32)
set(CMAKE_EXE_LINKER_FLAGS "/entry:mainCRTStartup ${CMAKE_EXE_LINKER_FLAGS}")
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "/entry:mainCRTStartup ${CMAKE_EXE_LINKER_FLAGS}")
else()
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-e,mainCRTStartup ${CMAKE_EXE_LINKER_FLAGS}")
endif(MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE ON)
endif (WIN32)

Expand Down

0 comments on commit 6c03a9a

Please sign in to comment.