Skip to content

Commit ebf8544

Browse files
committed
Merge remote-tracking branch 'origin/master' into rename-filename-comments
2 parents dcbd301 + e778e23 commit ebf8544

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+475
-1631
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
uses: actions/checkout@v1
3535
- name: Configure CMake
3636
run: cmake -P cmake/configure.cmake
37-
- name: Build wcmp
38-
run: cmake --build . --config Release --target wcmp
37+
- name: Build wcmp and unit test executable
38+
run: cmake --build . --config Release --target wcmp cse_tests
3939
working-directory: msvc/build
4040
- name: Download executable artifact
4141
uses: actions/download-artifact@v2

.gitignore

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
## CSE .gitignore
22

3-
# CSE generated files
4-
/src/untab.cpp
5-
/src/srfd.cpp
6-
/src/rcdef.sum
7-
/src/rcdef.err
8-
/src/rccn.h
9-
/src/dttab.cpp
10-
/src/dtypes.h
11-
/src/csevrsn.h
12-
13-
# RCDEF generated files
14-
/src/rcdef.err
15-
163
# test files
174
/test/*.rep
185
/test/*.csv

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "vendor/btwxt"]
1111
path = vendor/btwxt
1212
url = https://github.com/bigladder/btwxt.git
13+
[submodule "vendor/googletest"]
14+
path = vendor/googletest
15+
url = https://github.com/google/googletest.git

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,26 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
1515
find_package(Git QUIET)
1616

1717
add_subdirectory(vendor)
18+
19+
# Common source files TODO: Move to library when dtypes.h circularity is resolved.
20+
set(cse_common_source
21+
"${CSE_SOURCE_DIR}/src/cvpak.cpp"
22+
"${CSE_SOURCE_DIR}/src/dmpak.cpp"
23+
"${CSE_SOURCE_DIR}/src/envpak.cpp"
24+
"${CSE_SOURCE_DIR}/src/lookup.cpp"
25+
"${CSE_SOURCE_DIR}/src/messages.cpp"
26+
"${CSE_SOURCE_DIR}/src/msgtbl.cpp"
27+
"${CSE_SOURCE_DIR}/src/psychro.cpp"
28+
"${CSE_SOURCE_DIR}/src/rmkerr.cpp"
29+
"${CSE_SOURCE_DIR}/src/strpak.cpp"
30+
"${CSE_SOURCE_DIR}/src/tdpak.cpp"
31+
"${CSE_SOURCE_DIR}/src/xiopak.cpp"
32+
)
33+
1834
add_subdirectory(src)
1935

36+
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT CSE)
37+
2038
enable_testing()
2139

2240
add_subdirectory(test)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CSE is configured as a CMake project. Currently, CMake is only configured to gen
2323

2424
#### Testing
2525

26-
Automated testing of your build can be executed by running
26+
Automated testing of your build can be executed by running after building the entire solution
2727

2828
`ctest -C Release`
2929

cmake/CSEVersion.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ endif()
9090
message("Building CSE ${CSEVRSN_MAJOR}.${CSEVRSN_MINOR}.${CSEVRSN_PATCH}${CSEVRSN_PRERELEASE}${CSEVRSN_META}")
9191

9292
configure_file(
93-
"${PROJECT_SOURCE_DIR}/src/csevrsn.h.in"
94-
"${PROJECT_SOURCE_DIR}/src/csevrsn.h"
93+
"${PROJECT_SOURCE_DIR}/src/csevrsn.in.h"
94+
"${PROJECT_BINARY_DIR}/src/csevrsn.h"
9595
)

cmake/build.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ message("Building CSE...")
22
execute_process(COMMAND ${CMAKE_COMMAND}
33
--build ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build
44
--config Release
5+
--target CSE
56
-- -m
67
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build
78
RESULT_VARIABLE success

src/CMakeLists.txt

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
# Compile RCDEF
1+
add_library(cse_libstubs OBJECT libstubs.cpp)
2+
3+
target_include_directories(cse_libstubs PUBLIC
4+
"${CMAKE_SOURCE_DIR}/src/RCDEF" # stubs don't need legit dtypes.h
5+
"${CMAKE_SOURCE_DIR}/src"
6+
)
7+
8+
target_compile_features(cse_libstubs PUBLIC cxx_std_17)
9+
10+
11+
# Build RCDEF
212
add_subdirectory(RCDEF)
313

414
# Run C Preprocessor on *.DEF files
@@ -37,20 +47,21 @@ endforeach()
3747
# Run RCDEF
3848
add_custom_command(
3949
OUTPUT
40-
"${CMAKE_CURRENT_SOURCE_DIR}/dtypes.h"
41-
"${CMAKE_CURRENT_SOURCE_DIR}/rccn.h"
42-
"${CMAKE_CURRENT_SOURCE_DIR}/dttab.cpp"
43-
"${CMAKE_CURRENT_SOURCE_DIR}/srfd.cpp"
44-
"${CMAKE_CURRENT_SOURCE_DIR}/untab.cpp"
45-
"${CMAKE_CURRENT_SOURCE_DIR}/rcdef.sum"
50+
"${CMAKE_CURRENT_BINARY_DIR}/dtypes.h"
51+
"${CMAKE_CURRENT_BINARY_DIR}/rccn.h"
52+
"${CMAKE_CURRENT_BINARY_DIR}/dttab.cpp"
53+
"${CMAKE_CURRENT_BINARY_DIR}/srfd.cpp"
54+
"${CMAKE_CURRENT_BINARY_DIR}/untab.cpp"
55+
"${CMAKE_CURRENT_BINARY_DIR}/rcdef.sum"
4656
COMMAND RCDEF "${CMAKE_CURRENT_BINARY_DIR}/cndtypes.i" "${CMAKE_CURRENT_BINARY_DIR}/cnunits.i" "${CMAKE_CURRENT_BINARY_DIR}/dtlims.i" "${CMAKE_CURRENT_BINARY_DIR}/cnfields.i" "${CMAKE_CURRENT_BINARY_DIR}/cnrecs.i" . NUL NUL NUL .
4757
DEPENDS RCDEF "${CMAKE_CURRENT_BINARY_DIR}/cndtypes.i" "${CMAKE_CURRENT_BINARY_DIR}/cnunits.i" "${CMAKE_CURRENT_BINARY_DIR}/dtlims.i" "${CMAKE_CURRENT_BINARY_DIR}/cnfields.i" "${CMAKE_CURRENT_BINARY_DIR}/cnrecs.i"
48-
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
58+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
4959
)
5060

5161
# Set CSE Version
5262
add_custom_target(version_header
53-
DEPENDS ${PROJECT_SOURCE_DIR}/src/csevrsn.h.in
63+
DEPENDS "${PROJECT_SOURCE_DIR}/src/csevrsn.in.h"
64+
BYPRODUCTS "${PROJECT_BINARY_DIR}/src/csevrsn.h"
5465
COMMAND ${CMAKE_COMMAND}
5566
ARGS -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
5667
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
@@ -99,43 +110,34 @@ set(source
99110
cuparse.cpp
100111
cuprobe.cpp
101112
cutok.cpp
102-
cvpak.cpp
103113
datfcns.cpp
104114
dhwcalc.cpp
105115
dhwsolar.cpp
106-
dmpak.cpp
107116
dttab.cpp
108-
envpak.cpp
109117
exman.cpp
110118
foundation.cpp
111119
gmutil.cpp
112120
geometry.cpp
113121
hvac.cpp
114122
impf.cpp
115-
lookup.cpp
116-
messages.cpp
117-
msgtbl.cpp
118123
mspak.cpp
119124
nummeth.cpp
120125
pgpak.cpp
121126
pp.cpp
122-
psychro.cpp
123127
pvcalc.cpp
124-
rmkerr.cpp
125128
shading.cpp
126129
solar.cpp
127-
srfd.cpp
128-
strpak.cpp
129130
sytb.cpp
130-
tdpak.cpp
131131
timer.cpp
132-
untab.cpp
133132
vrpak.cpp
134133
wfpak.cpp
135-
xiopak.cpp
136134
yacam.cpp
135+
"${CMAKE_CURRENT_BINARY_DIR}/srfd.cpp"
136+
"${CMAKE_CURRENT_BINARY_DIR}/untab.cpp"
137137
)
138138

139+
list(APPEND source ${cse_common_source})
140+
139141
set(precomp
140142
StdAfx.cpp
141143
)
@@ -160,7 +162,6 @@ set(headers
160162
cprint.h
161163
cse.h
162164
cseface.h
163-
csevrsn.h
164165
cueval.h
165166
cuevf.h
166167
cul.h
@@ -171,7 +172,6 @@ set(headers
171172
cvpak.h
172173
datfcns.h
173174
dmpak.h
174-
dtypes.h
175175
envpak.h
176176
exman.h
177177
foundation.h
@@ -188,7 +188,6 @@ set(headers
188188
pgpak.h
189189
pp.h
190190
psychro.h
191-
rccn.h
192191
rmkerr.h
193192
solar.h
194193
srd.h
@@ -201,22 +200,16 @@ set(headers
201200
wfpak.h
202201
xiopak.h
203202
yacam.h
203+
"${CMAKE_CURRENT_BINARY_DIR}/csevrsn.h"
204+
"${CMAKE_CURRENT_BINARY_DIR}/dtypes.h"
205+
"${CMAKE_CURRENT_BINARY_DIR}/rccn.h"
204206
)
205207

206208
if(USE_XMODULE) # Runtime Share Library interface - Not used since Version 0.899. (Windows only)
207209
list(APPEND source xmodule.cpp)
208210
list(APPEND headers xmodule.h)
209211
endif()
210212

211-
include_directories(
212-
"${CMAKE_SOURCE_DIR}/src"
213-
"${CMAKE_SOURCE_DIR}/vendor"
214-
"${CMAKE_SOURCE_DIR}/vendor/Penumbra/include"
215-
"${CMAKE_SOURCE_DIR}/vendor/HPWHsim/src"
216-
"${CMAKE_BINARY_DIR}/vendor/HPWHsim/src"
217-
"${btwxt_SOURCE_DIR}/src"
218-
)
219-
220213
# Precompiled Headers
221214
macro(addMSVCPrecompiledHeader PrecompiledHeader PrecompiledSourceVar SourcesVar)
222215
if(MSVC)
@@ -240,6 +233,16 @@ addMSVCPrecompiledHeader("cnglob.h" precomp source)
240233

241234
# Final executable/linking
242235
add_executable(CSE ${source} ${rcFile} ${headers})
236+
237+
target_include_directories(CSE PRIVATE
238+
"${CSE_BINARY_DIR}/src"
239+
"${CSE_SOURCE_DIR}/src"
240+
"${penumbra_SOURCE_DIR}/include"
241+
"${HPWHsim_SOURCE_DIR}/src"
242+
"${HPWHsim_BINARY_DIR}/src"
243+
"${btwxt_SOURCE_DIR}/src"
244+
)
245+
243246
target_compile_features(CSE PUBLIC cxx_std_17)
244247

245248
if(USE_XMODULE)

src/RCDEF/CMakeLists.txt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
set(source
2-
../cvpak.cpp
3-
../dmpak.cpp
4-
../envpak.cpp
5-
../lookup.cpp
6-
../messages.cpp
7-
../msgtbl.cpp
8-
../rcdef.cpp
9-
../rmkerr.cpp
10-
../strpak.cpp
11-
../tdpak.cpp
12-
../xiopak.cpp
2+
rcdef.cpp
3+
$<TARGET_OBJECTS:cse_libstubs>
134
)
145

6+
list(APPEND source ${cse_common_source})
7+
8+
159
set(headers
1610
../cnglob.h
1711
../dmpak.h
@@ -27,7 +21,7 @@ include_directories(
2721
.
2822
)
2923

30-
add_definitions(-DNOVRR)
3124

3225
add_executable(RCDEF ${source} ${headers})
3326
target_compile_features(RCDEF PRIVATE cxx_std_17)
27+
target_compile_definitions(RCDEF PRIVATE NOVRR)

0 commit comments

Comments
 (0)