Skip to content

Commit

Permalink
improve CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 18, 2024
1 parent 6cc30b5 commit e50b691
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# using Clang
if (CMAKE_BUILD_TYPE MATCHES "^Release$")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS "-static -O3 -Wall -pedantic")
set(CMAKE_CXX_FLAGS "-static -O3 -Wall -pedantic")
else()
Expand All @@ -50,14 +50,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
if (CMAKE_BUILD_TYPE MATCHES "^Release$")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS "-s -static -O3 -Wall -pedantic")
set(CMAKE_CXX_FLAGS "-s -static -O3 -Wall -pedantic")
else()
set(CMAKE_C_FLAGS "-static -g -Wall -pedantic")
set(CMAKE_CXX_FLAGS "-static -g -Wall -pedantic")
endif()
elseif (MSVC AND (CMAKE_BUILD_TYPE MATCHES "^Release$"))
elseif (MSVC AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
# replace "/MD" with "/MT" (building without runtime DLLs)
set(CompilerFlags
CMAKE_C_FLAGS
Expand Down

0 comments on commit e50b691

Please sign in to comment.