Skip to content

Commit

Permalink
fixed wrong cmake configurations and removed deprecated architecture …
Browse files Browse the repository at this point in the history
…detection
  • Loading branch information
pmbittner committed Mar 29, 2020
1 parent d303cc6 commit 1ba38cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 165 deletions.
11 changes: 5 additions & 6 deletions cmake/PaxArchitectureDetection.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Requires: Set variable CMAKE_MODULE_PATH
# Defines: PAX_OS_ARCHITECTURE

#include(${CMAKE_MODULE_PATH}/TargetArch.cmake)
set(PAX_OS_ARCHITECTURE x64) # This is the default value
set(PAX_OS_ARCHITECTURE x86) # This is the default value

if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PAX_OS_ARCHITECTURE x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(PAX_OS_ARCHITECTURE x86)
else()
message(WARNING "Unknown Architecture: CMAKE_SIZEOF_VOID_P is ${CMAKE_SIZEOF_VOID_P}")
message(WARNING "Continuing with ${PAX_OS_ARCHITECTURE}")
endif()


#target_architecture(PAX_OS_ARCHITECTURE)
#simplifyArchitecture(PAX_OS_ARCHITECTURE)
message("PAX_OS_ARCHITECTURE is ${PAX_OS_ARCHITECTURE}")
30 changes: 15 additions & 15 deletions cmake/PaxFlagsDefinition.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ if (WIN32)
message(" and MSVC")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++${PAX_CXX_STANDARD}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")

# Replace each occurence of /MD with /MT for static linking an avoid warnings for multiple definition
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
#
# # Replace each occurence of /MD with /MT for static linking an avoid warnings for multiple definition
# set(CompilerFlags
# CMAKE_CXX_FLAGS
# CMAKE_CXX_FLAGS_DEBUG
# CMAKE_CXX_FLAGS_RELEASE
# CMAKE_C_FLAGS
# CMAKE_C_FLAGS_DEBUG
# CMAKE_C_FLAGS_RELEASE
# )
# foreach(CompilerFlag ${CompilerFlags})
# string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
# endforeach()
else(${PAX_COMPILER_IS_MSVC}) # condition for nested if
message(" but not MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -std=c++${PAX_CXX_STANDARD}")# "-static-libgcc -static-libstdc++") #this may be wrong for unix
Expand Down
144 changes: 0 additions & 144 deletions cmake/TargetArch.cmake

This file was deleted.

0 comments on commit 1ba38cf

Please sign in to comment.