Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ option(USE_GLYCOL_CACHING "Use glycol cashing routines" ON)
option(USE_PSYCH_STATS "Compute psychrometric stats" OFF)
option(USE_PSYCH_ERRORS "Report psychrometric errors " ON)

if(APPLE AND CMAKE_GENERATOR STREQUAL "Xcode" AND OPENGL_FOUND)
set(OPENGL_FOUND FALSE)
message(STATUS "Disabling OpenGL for Xcode-generated builds to avoid Cocoa window creation during build/test execution")
endif()
Comment on lines +95 to +98

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Penumbra want to create some windows behind the scenes when OpenGL is enabled, which it is by default. We could probably have worked through that, but since this isn't likely to be used by many of our developers, I figured we'd just turn it off when running from an Xcode generated build.


mark_as_advanced(BUILD_OBJEXXFCL_TESTING)

#######################################################################
Expand Down
11 changes: 9 additions & 2 deletions cmake/ProjectMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ macro(CREATE_TEST_TARGETS BASE_NAME SRC DEPENDENCIES USE_PCH)

target_link_libraries(${BASE_NAME}_tests PRIVATE ${ALL_DEPENDENCIES} gtest)

if(APPLE AND CMAKE_GENERATOR STREQUAL "Xcode")
set(_gtest_discovery_mode PRE_TEST)
else()
set(_gtest_discovery_mode POST_BUILD)
endif()
Comment on lines +86 to +90

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, this was due to something related to Xcode and code signing, which we are not doing during development builds.


gtest_discover_tests(${BASE_NAME}_tests
DISCOVERY_TIMEOUT 30
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DISCOVERY_MODE ${_gtest_discovery_mode}
DISCOVERY_TIMEOUT 30
)

endif()
Expand Down
1 change: 1 addition & 0 deletions idd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ add_custom_command(

add_executable(generate_embeddable_epJSON_schema embedded/generate_embeddable_epJSON_schema.cpp)
target_link_libraries(generate_embeddable_epJSON_schema PRIVATE project_options project_fp_options project_warnings fmt::fmt)
target_compile_options(generate_embeddable_epJSON_schema PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-shorten-64-to-32>)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns this into a warning. I think this should just apply to AppleClang and I thought I changed it to that everywhere else, but now I see that I missed this one. I'll probably just leave it.

set_target_properties(generate_embeddable_epJSON_schema PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/scripts")
# See https://en.cppreference.com/w/cpp/filesystem#Notes
if ((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetwork/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_C
endif()

target_include_directories(airflownetworklib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(airflownetworklib PUBLIC btwxt fmt::fmt)
target_link_libraries(airflownetworklib PUBLIC btwxt fmt::fmt PRIVATE nlohmann_json)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My machine was complaining about the nlohman json.hpp #include <doj/alphanum.hpp>. This fixed it.

4 changes: 2 additions & 2 deletions src/EnergyPlus/UtilityRoutines.hh
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,13 @@ namespace Util {
inline int FindIntInList(Array1_int &list, int item)
{
auto it = std::find(list.begin(), list.end(), item);
return (it == list.end()) ? -1 : (it - list.begin());
return (it == list.end()) ? -1 : static_cast<int>(it - list.begin());
}

inline int FindIntInList(std::vector<int> &list, int item)
{
auto it = std::find(list.begin(), list.end(), item);
return (it == list.end()) ? -1 : (it - list.begin());
return (it == list.end()) ? -1 : static_cast<int>(it - list.begin());
}

int FindItemInList(std::string_view const String, Array1S_string const ListOfItems, int NumItems);
Expand Down
2 changes: 1 addition & 1 deletion third_party/BCVTB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ IF (UNIX)
ENDIF()

ADD_LIBRARY( bcvtb STATIC ${SRC} )
target_compile_options(bcvtb PRIVATE $<$<COMPILE_LANG_AND_ID:C,AppleClang>:-Wno-shorten-64-to-32>)

IF( WIN32 )
TARGET_LINK_LIBRARIES( bcvtb wsock32 )
Expand All @@ -28,4 +29,3 @@ set_target_properties(
INSTALL_NAME_DIR "@executable_path"
)


4 changes: 3 additions & 1 deletion third_party/CLI/CLI11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@
#endif

/** <codecvt> availability */
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
#if defined(__APPLE__) && defined(__clang__)
#define CLI11_HAS_CODECVT 0
#elif defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
#define CLI11_HAS_CODECVT 0
#else
#define CLI11_HAS_CODECVT 1
Expand Down
17 changes: 14 additions & 3 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ target_compile_definitions(
if(NOT MSVC) # This is really only needed with newer Clang, but gcc is fine with it
target_compile_options(nlohmann_json INTERFACE -Wno-deprecated-declarations)
endif()
target_compile_options(nlohmann_json INTERFACE $<$<COMPILE_LANG_AND_ID:CXX,AppleClang>:-Wno-shorten-64-to-32>)
target_include_directories(
nlohmann_json
SYSTEM INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/nlohmann>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
set_source_files_properties(
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/nlohmann>/json.hpp
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/nlohmann/json.hpp
TARGET_DIRECTORY nlohmann_json
PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations
)
Expand Down Expand Up @@ -133,6 +134,15 @@ if(BUILD_TESTING)
set_target_properties(gtest_main PROPERTIES FOLDER ThirdParty/gtest)
set_target_properties(gmock PROPERTIES FOLDER ThirdParty/gtest)
set_target_properties(gmock_main PROPERTIES FOLDER ThirdParty/gtest)
foreach(_gtest_target gtest gtest_main gmock gmock_main)
if(TARGET ${_gtest_target})
target_compile_options(${_gtest_target}
PRIVATE
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-character-conversion>
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-deprecated-declarations>
Comment on lines +141 to +142

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies these based on what's available in each compiler.

)
endif()
endforeach()
endif()

add_subdirectory(ObjexxFCL)
Expand Down Expand Up @@ -162,6 +172,8 @@ set_target_properties(re2 PROPERTIES FOLDER ThirdParty/re2)
add_subdirectory(fmt-8.0.1)
target_compile_definitions(fmt PRIVATE FMT_USE_FULL_CACHE_DRAGONBOX=1)
set_target_properties(fmt PROPERTIES FOLDER ThirdParty/fmt)
target_compile_options(fmt PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-deprecated-literal-operator>)
target_compile_definitions(fmt PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:FMT_CONSTEVAL=>)
mark_as_advanced(FORCE FMT_SYSTEM_HEADERS)

# Kiva
Expand Down Expand Up @@ -224,4 +236,3 @@ add_subdirectory(libtk205)
mark_as_advanced(FORCE libtk205_STATIC_LIB)
mark_as_advanced(FORCE libtk205_COVERAGE)
mark_as_advanced(FORCE libtk205_BUILD_TESTING)

2 changes: 1 addition & 1 deletion third_party/Expat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ IF ( CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
ENDIF()

add_library(epexpat STATIC ${epexpat_SRCS})
target_compile_options(epexpat PRIVATE $<$<COMPILE_LANG_AND_ID:C,AppleClang>:-Wno-shorten-64-to-32>)

set_target_properties(
epexpat
PROPERTIES
INSTALL_NAME_DIR "@executable_path"
)


2 changes: 2 additions & 0 deletions third_party/SQLite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ set(SRC sqlite3.h sqlite3.c)

add_library(sqlite ${SRC})

target_compile_options(sqlite PRIVATE $<$<COMPILE_LANG_AND_ID:C,AppleClang>:-Wno-shorten-64-to-32>)

if(MSVC) # visual c++ (VS 2013)
target_compile_options(sqlite PRIVATE -W0)
elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")# g++/Clang
Expand Down
2 changes: 1 addition & 1 deletion third_party/btwxt/vendor/courierr/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ target_link_libraries(${PROJECT_NAME}_tests PRIVATE ${PROJECT_NAME} gtest fmt)
target_compile_features(${PROJECT_NAME}_tests PRIVATE cxx_std_17)

include(GoogleTest)
gtest_discover_tests(${PROJECT_NAME}_tests)
gtest_discover_tests(${PROJECT_NAME}_tests)
4 changes: 2 additions & 2 deletions third_party/fmt-8.0.1/include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ constexpr auto operator""_a()
return {};
}
# else
constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
constexpr auto operator""_a(const char* s, size_t) -> detail::udl_arg<char> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were a couple random things like this that it didn't like.

return {s};
}
# endif
Expand All @@ -2882,7 +2882,7 @@ constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
std::string message = "The answer is {}"_format(42);
\endrst
*/
constexpr auto operator"" _format(const char* s, size_t n)
constexpr auto operator""_format(const char* s, size_t n)
-> detail::udl_formatter<char> {
return {{s, n}};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ inline void PrintTo(char16_t c, ::std::ostream* os) {
}
#ifdef __cpp_char8_t
inline void PrintTo(char8_t c, ::std::ostream* os) {
PrintTo(ImplicitCast_<char32_t>(c), os);
PrintTo(static_cast<char32_t>(c), os);
}
#endif

Expand Down
1 change: 1 addition & 0 deletions third_party/penumbra/vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_library(tess2 ${libtess2_sources})

target_include_directories(tess2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libtess2/Include)
target_include_directories(tess2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libtess2/Source)
target_compile_options(tess2 PRIVATE $<$<COMPILE_LANG_AND_ID:C,AppleClang>:-Wno-shorten-64-to-32>)

if (NOT TARGET courierr)
add_subdirectory(courierr)
Expand Down
1 change: 1 addition & 0 deletions third_party/re2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ set(RE2_SOURCES

add_library(re2 ${RE2_SOURCES})
target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_compile_options(re2 PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,AppleClang>:-Wno-shorten-64-to-32>)
set_target_properties(re2 PROPERTIES SOVERSION ${SONAME} VERSION ${SONAME}.0.0)
add_library(re2::re2 ALIAS re2)

Expand Down
Loading